You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2021/02/09 18:55:00 UTC

[httpcomponents-core] 01/02: Removed references to deprecated Assert#assertThat

This is an automated email from the ASF dual-hosted git repository.

olegk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git

commit 35873412ba799f78c953898e93e02e512d1a5437
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Tue Feb 9 17:53:04 2021 +0100

    Removed references to deprecated Assert#assertThat
---
 .../hc/core5/http2/hpack/TestHPackCoding.java      | 17 ++---
 .../hc/core5/benchmark/ResultFormatterTest.java    | 12 ++--
 .../testing/classic/ClassicAuthenticationTest.java | 36 +++++-----
 .../classic/ClassicServerAndRequesterTest.java     | 34 ++++-----
 .../testing/classic/ClassicTLSIntegrationTest.java | 24 +++----
 .../testing/framework/TestTestingFramework.java    | 35 ++++-----
 .../apache/hc/core5/testing/nio/H2AlpnTest.java    | 26 +++----
 .../hc/core5/testing/nio/H2IntegrationTest.java    | 71 +++++++++---------
 .../testing/nio/H2ProtocolNegotiationTest.java     | 32 ++++-----
 .../nio/H2ServerAndMultiplexingRequesterTest.java  | 64 ++++++++---------
 .../testing/nio/H2ServerAndRequesterTest.java      | 58 +++++++--------
 .../hc/core5/testing/nio/H2TLSIntegrationTest.java | 40 +++++------
 .../core5/testing/nio/Http1AuthenticationTest.java | 52 +++++++-------
 .../testing/nio/Http1ServerAndRequesterTest.java   | 84 +++++++++++-----------
 .../core5/concurrent/TestComplexCancellable.java   |  7 +-
 .../hc/core5/concurrent/TestComplexFuture.java     | 23 +++---
 .../core5/http/config/TestNamedElementChain.java   | 80 ++++++++++-----------
 .../core5/http/impl/nio/TestExpandableBuffer.java  | 42 +++++------
 .../hc/core5/http/ssl/TestTlsVersionParser.java    | 16 ++---
 .../core5/reactor/TestAbstractIOSessionPool.java   | 68 +++++++++---------
 .../org/apache/hc/core5/util/TestTimeValue.java    | 47 ++++++------
 21 files changed, 437 insertions(+), 431 deletions(-)

diff --git a/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/hpack/TestHPackCoding.java b/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/hpack/TestHPackCoding.java
index 8e71d5f..d296f85 100644
--- a/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/hpack/TestHPackCoding.java
+++ b/httpcore5-h2/src/test/java/org/apache/hc/core5/http2/hpack/TestHPackCoding.java
@@ -27,19 +27,20 @@
 
 package org.apache.hc.core5.http2.hpack;
 
-import java.nio.ByteBuffer;
-import java.nio.charset.Charset;
-import java.nio.charset.StandardCharsets;
-import java.util.Arrays;
-import java.util.List;
-
 import org.apache.hc.core5.http.Header;
 import org.apache.hc.core5.http.message.BasicHeader;
 import org.apache.hc.core5.util.ByteArrayBuffer;
 import org.hamcrest.CoreMatchers;
+import org.hamcrest.MatcherAssert;
 import org.junit.Assert;
 import org.junit.Test;
 
+import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
+import java.util.List;
+
 public class TestHPackCoding {
 
     @Test
@@ -1053,10 +1054,10 @@ public class TestHPackCoding {
                                 "123456789012345678901234567890123456789012345678901234567890")),
                 false);
 
-        Assert.assertThat(decoder.decodeHeaders(wrap(buf)).size(), CoreMatchers.equalTo(2));
+        MatcherAssert.assertThat(decoder.decodeHeaders(wrap(buf)).size(), CoreMatchers.equalTo(2));
 
         decoder.setMaxListSize(1000000);
-        Assert.assertThat(decoder.decodeHeaders(wrap(buf)).size(), CoreMatchers.equalTo(2));
+        MatcherAssert.assertThat(decoder.decodeHeaders(wrap(buf)).size(), CoreMatchers.equalTo(2));
 
         decoder.setMaxListSize(200);
         decoder.decodeHeaders(wrap(buf));
diff --git a/httpcore5-testing/src/test/java/org/apache/hc/core5/benchmark/ResultFormatterTest.java b/httpcore5-testing/src/test/java/org/apache/hc/core5/benchmark/ResultFormatterTest.java
index 023f81b..bde0796 100644
--- a/httpcore5-testing/src/test/java/org/apache/hc/core5/benchmark/ResultFormatterTest.java
+++ b/httpcore5-testing/src/test/java/org/apache/hc/core5/benchmark/ResultFormatterTest.java
@@ -26,15 +26,15 @@
  */
 package org.apache.hc.core5.benchmark;
 
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
-import java.nio.charset.StandardCharsets;
-
 import org.apache.hc.core5.http.HttpVersion;
 import org.hamcrest.CoreMatchers;
-import org.junit.Assert;
+import org.hamcrest.MatcherAssert;
 import org.junit.Test;
 
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import java.nio.charset.StandardCharsets;
+
 public class ResultFormatterTest {
 
     @Test
@@ -56,7 +56,7 @@ public class ResultFormatterTest {
                 50000000);
         final ByteArrayOutputStream buf = new ByteArrayOutputStream();
         ResultFormatter.print(new PrintStream(buf, true, StandardCharsets.US_ASCII.name()), results);
-        Assert.assertThat(new String(buf.toByteArray(), StandardCharsets.US_ASCII).replace("\r\n", "\n"),
+        MatcherAssert.assertThat(new String(buf.toByteArray(), StandardCharsets.US_ASCII).replace("\r\n", "\n"),
                 CoreMatchers.equalTo(
                 "Server Software:\t\tTestServer/1.1\n" +
                         "Protocol version:\t\tHTTP/1.1\n" +
diff --git a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/classic/ClassicAuthenticationTest.java b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/classic/ClassicAuthenticationTest.java
index c14254d..707f4c7 100644
--- a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/classic/ClassicAuthenticationTest.java
+++ b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/classic/ClassicAuthenticationTest.java
@@ -27,11 +27,6 @@
 
 package org.apache.hc.core5.testing.classic;
 
-import java.nio.charset.StandardCharsets;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Random;
-
 import org.apache.hc.core5.http.ClassicHttpRequest;
 import org.apache.hc.core5.http.ClassicHttpResponse;
 import org.apache.hc.core5.http.ContentType;
@@ -60,7 +55,7 @@ import org.apache.hc.core5.io.CloseMode;
 import org.apache.hc.core5.net.URIAuthority;
 import org.apache.hc.core5.util.Timeout;
 import org.hamcrest.CoreMatchers;
-import org.junit.Assert;
+import org.hamcrest.MatcherAssert;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExternalResource;
@@ -69,6 +64,11 @@ import org.junit.runners.Parameterized;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Random;
+
 @RunWith(Parameterized.class)
 public class ClassicAuthenticationTest {
 
@@ -193,16 +193,16 @@ public class ClassicAuthenticationTest {
         final HttpCoreContext context = HttpCoreContext.create();
         final ClassicHttpRequest request1 = new BasicClassicHttpRequest(Method.GET, "/stuff");
         try (final ClassicHttpResponse response1 = requester.execute(target, request1, TIMEOUT, context)) {
-            Assert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_UNAUTHORIZED));
+            MatcherAssert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_UNAUTHORIZED));
             final String body1 = EntityUtils.toString(response1.getEntity());
-            Assert.assertThat(body1, CoreMatchers.equalTo("You shall not pass!!!"));
+            MatcherAssert.assertThat(body1, CoreMatchers.equalTo("You shall not pass!!!"));
         }
         final ClassicHttpRequest request2 = new BasicClassicHttpRequest(Method.GET, "/stuff");
         request2.setHeader(HttpHeaders.AUTHORIZATION, "let me pass");
         try (final ClassicHttpResponse response2 = requester.execute(target, request2, TIMEOUT, context)) {
-            Assert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+            MatcherAssert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
             final String body1 = EntityUtils.toString(response2.getEntity());
-            Assert.assertThat(body1, CoreMatchers.equalTo(""));
+            MatcherAssert.assertThat(body1, CoreMatchers.equalTo(""));
         }
     }
 
@@ -219,17 +219,17 @@ public class ClassicAuthenticationTest {
         final ClassicHttpRequest request1 = new BasicClassicHttpRequest(Method.POST, "/stuff");
         request1.setEntity(new ByteArrayEntity(stuff, ContentType.TEXT_PLAIN));
         try (final ClassicHttpResponse response1 = requester.execute(target, request1, TIMEOUT, context)) {
-            Assert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_UNAUTHORIZED));
+            MatcherAssert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_UNAUTHORIZED));
             final String body1 = EntityUtils.toString(response1.getEntity());
-            Assert.assertThat(body1, CoreMatchers.equalTo("You shall not pass!!!"));
+            MatcherAssert.assertThat(body1, CoreMatchers.equalTo("You shall not pass!!!"));
         }
         final ClassicHttpRequest request2 = new BasicClassicHttpRequest(Method.POST, "/stuff");
         request2.setHeader(HttpHeaders.AUTHORIZATION, "let me pass");
         request2.setEntity(new ByteArrayEntity(stuff, ContentType.TEXT_PLAIN));
         try (final ClassicHttpResponse response2 = requester.execute(target, request2, TIMEOUT, context)) {
-            Assert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+            MatcherAssert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
             final String body1 = EntityUtils.toString(response2.getEntity());
-            Assert.assertThat(body1, CoreMatchers.equalTo(new String(stuff, StandardCharsets.US_ASCII)));
+            MatcherAssert.assertThat(body1, CoreMatchers.equalTo(new String(stuff, StandardCharsets.US_ASCII)));
         }
     }
 
@@ -247,18 +247,18 @@ public class ClassicAuthenticationTest {
         request1.setVersion(HttpVersion.HTTP_1_0);
         request1.setEntity(new ByteArrayEntity(stuff, ContentType.TEXT_PLAIN));
         try (final ClassicHttpResponse response1 = requester.execute(target, request1, TIMEOUT, context)) {
-            Assert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_UNAUTHORIZED));
+            MatcherAssert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_UNAUTHORIZED));
             final String body1 = EntityUtils.toString(response1.getEntity());
-            Assert.assertThat(body1, CoreMatchers.equalTo("You shall not pass!!!"));
+            MatcherAssert.assertThat(body1, CoreMatchers.equalTo("You shall not pass!!!"));
         }
         final ClassicHttpRequest request2 = new BasicClassicHttpRequest(Method.POST, "/stuff");
         request2.setHeader(HttpHeaders.AUTHORIZATION, "let me pass");
         request2.setVersion(HttpVersion.HTTP_1_0);
         request2.setEntity(new ByteArrayEntity(stuff, ContentType.TEXT_PLAIN));
         try (final ClassicHttpResponse response2 = requester.execute(target, request2, TIMEOUT, context)) {
-            Assert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+            MatcherAssert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
             final String body1 = EntityUtils.toString(response2.getEntity());
-            Assert.assertThat(body1, CoreMatchers.equalTo(new String(stuff, StandardCharsets.US_ASCII)));
+            MatcherAssert.assertThat(body1, CoreMatchers.equalTo(new String(stuff, StandardCharsets.US_ASCII)));
         }
     }
 
diff --git a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/classic/ClassicServerAndRequesterTest.java b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/classic/ClassicServerAndRequesterTest.java
index 462cd8d..77b1f2b 100644
--- a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/classic/ClassicServerAndRequesterTest.java
+++ b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/classic/ClassicServerAndRequesterTest.java
@@ -27,10 +27,6 @@
 
 package org.apache.hc.core5.testing.classic;
 
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Collection;
-
 import org.apache.hc.core5.http.ClassicHttpRequest;
 import org.apache.hc.core5.http.ClassicHttpResponse;
 import org.apache.hc.core5.http.ContentType;
@@ -58,7 +54,7 @@ import org.apache.hc.core5.io.CloseMode;
 import org.apache.hc.core5.testing.SSLTestContexts;
 import org.apache.hc.core5.util.Timeout;
 import org.hamcrest.CoreMatchers;
-import org.junit.Assert;
+import org.hamcrest.MatcherAssert;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExternalResource;
@@ -67,6 +63,10 @@ import org.junit.runners.Parameterized;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Collection;
+
 @RunWith(Parameterized.class)
 public class ClassicServerAndRequesterTest {
 
@@ -189,23 +189,23 @@ public class ClassicServerAndRequesterTest {
         final ClassicHttpRequest request1 = new BasicClassicHttpRequest(Method.POST, "/stuff");
         request1.setEntity(new StringEntity("some stuff", ContentType.TEXT_PLAIN));
         try (final ClassicHttpResponse response1 = requester.execute(target, request1, TIMEOUT, context)) {
-            Assert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+            MatcherAssert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
             final String body1 = EntityUtils.toString(response1.getEntity());
-            Assert.assertThat(body1, CoreMatchers.equalTo("some stuff"));
+            MatcherAssert.assertThat(body1, CoreMatchers.equalTo("some stuff"));
         }
         final ClassicHttpRequest request2 = new BasicClassicHttpRequest(Method.POST, "/other-stuff");
         request2.setEntity(new StringEntity("some other stuff", ContentType.TEXT_PLAIN));
         try (final ClassicHttpResponse response2 = requester.execute(target, request2, TIMEOUT, context)) {
-            Assert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+            MatcherAssert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
             final String body2 = EntityUtils.toString(response2.getEntity());
-            Assert.assertThat(body2, CoreMatchers.equalTo("some other stuff"));
+            MatcherAssert.assertThat(body2, CoreMatchers.equalTo("some other stuff"));
         }
         final ClassicHttpRequest request3 = new BasicClassicHttpRequest(Method.POST, "/more-stuff");
         request3.setEntity(new StringEntity("some more stuff", ContentType.TEXT_PLAIN));
         try (final ClassicHttpResponse response3 = requester.execute(target, request3, TIMEOUT, context)) {
-            Assert.assertThat(response3.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+            MatcherAssert.assertThat(response3.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
             final String body3 = EntityUtils.toString(response3.getEntity());
-            Assert.assertThat(body3, CoreMatchers.equalTo("some more stuff"));
+            MatcherAssert.assertThat(body3, CoreMatchers.equalTo("some more stuff"));
         }
     }
 
@@ -217,23 +217,23 @@ public class ClassicServerAndRequesterTest {
         final ClassicHttpRequest request1 = new BasicClassicHttpRequest(Method.POST, "/no-keep-alive/stuff");
         request1.setEntity(new StringEntity("some stuff", ContentType.TEXT_PLAIN));
         try (final ClassicHttpResponse response1 = requester.execute(target, request1, TIMEOUT, context)) {
-            Assert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+            MatcherAssert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
             final String body1 = EntityUtils.toString(response1.getEntity());
-            Assert.assertThat(body1, CoreMatchers.equalTo("some stuff"));
+            MatcherAssert.assertThat(body1, CoreMatchers.equalTo("some stuff"));
         }
         final ClassicHttpRequest request2 = new BasicClassicHttpRequest(Method.POST, "/no-keep-alive/other-stuff");
         request2.setEntity(new StringEntity("some other stuff", ContentType.TEXT_PLAIN));
         try (final ClassicHttpResponse response2 = requester.execute(target, request2, TIMEOUT, context)) {
-            Assert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+            MatcherAssert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
             final String body2 = EntityUtils.toString(response2.getEntity());
-            Assert.assertThat(body2, CoreMatchers.equalTo("some other stuff"));
+            MatcherAssert.assertThat(body2, CoreMatchers.equalTo("some other stuff"));
         }
         final ClassicHttpRequest request3 = new BasicClassicHttpRequest(Method.POST, "/no-keep-alive/more-stuff");
         request3.setEntity(new StringEntity("some more stuff", ContentType.TEXT_PLAIN));
         try (final ClassicHttpResponse response3 = requester.execute(target, request3, TIMEOUT, context)) {
-            Assert.assertThat(response3.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+            MatcherAssert.assertThat(response3.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
             final String body3 = EntityUtils.toString(response3.getEntity());
-            Assert.assertThat(body3, CoreMatchers.equalTo("some more stuff"));
+            MatcherAssert.assertThat(body3, CoreMatchers.equalTo("some more stuff"));
         }
     }
 
diff --git a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/classic/ClassicTLSIntegrationTest.java b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/classic/ClassicTLSIntegrationTest.java
index bd344b0..df95f32 100644
--- a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/classic/ClassicTLSIntegrationTest.java
+++ b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/classic/ClassicTLSIntegrationTest.java
@@ -27,14 +27,6 @@
 
 package org.apache.hc.core5.testing.classic;
 
-import java.io.IOException;
-import java.util.concurrent.atomic.AtomicReference;
-
-import javax.net.ssl.SSLException;
-import javax.net.ssl.SSLHandshakeException;
-import javax.net.ssl.SSLParameters;
-import javax.net.ssl.SSLSession;
-
 import org.apache.hc.core5.function.Callback;
 import org.apache.hc.core5.http.ClassicHttpRequest;
 import org.apache.hc.core5.http.ClassicHttpResponse;
@@ -60,11 +52,19 @@ import org.apache.hc.core5.ssl.SSLContexts;
 import org.apache.hc.core5.testing.SSLTestContexts;
 import org.apache.hc.core5.util.Timeout;
 import org.hamcrest.CoreMatchers;
+import org.hamcrest.MatcherAssert;
 import org.junit.Assert;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExternalResource;
 
+import javax.net.ssl.SSLException;
+import javax.net.ssl.SSLHandshakeException;
+import javax.net.ssl.SSLParameters;
+import javax.net.ssl.SSLSession;
+import java.io.IOException;
+import java.util.concurrent.atomic.AtomicReference;
+
 public class ClassicTLSIntegrationTest {
 
     private static final Timeout TIMEOUT = Timeout.ofSeconds(30);
@@ -140,15 +140,15 @@ public class ClassicTLSIntegrationTest {
         final ClassicHttpRequest request1 = new BasicClassicHttpRequest(Method.POST, "/stuff");
         request1.setEntity(new StringEntity("some stuff", ContentType.TEXT_PLAIN));
         try (final ClassicHttpResponse response1 = requester.execute(target, request1, TIMEOUT, context)) {
-            Assert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+            MatcherAssert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
             final String body1 = EntityUtils.toString(response1.getEntity());
-            Assert.assertThat(body1, CoreMatchers.equalTo("some stuff"));
+            MatcherAssert.assertThat(body1, CoreMatchers.equalTo("some stuff"));
         }
 
         final SSLSession sslSession = sslSessionRef.getAndSet(null);
         final ProtocolVersion tlsVersion = TLS.parse(sslSession.getProtocol());
-        Assert.assertThat(tlsVersion.greaterEquals(TLS.V_1_2.version), CoreMatchers.equalTo(true));
-        Assert.assertThat(sslSession.getPeerPrincipal().getName(),
+        MatcherAssert.assertThat(tlsVersion.greaterEquals(TLS.V_1_2.version), CoreMatchers.equalTo(true));
+        MatcherAssert.assertThat(sslSession.getPeerPrincipal().getName(),
                 CoreMatchers.equalTo("CN=localhost,OU=Apache HttpComponents,O=Apache Software Foundation"));
     }
 
diff --git a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/framework/TestTestingFramework.java b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/framework/TestTestingFramework.java
index c9b7980..5877106 100644
--- a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/framework/TestTestingFramework.java
+++ b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/framework/TestTestingFramework.java
@@ -27,6 +27,23 @@
 
 package org.apache.hc.core5.testing.framework;
 
+import org.apache.hc.core5.http.ContentType;
+import org.apache.hc.core5.http.HttpVersion;
+import org.apache.hc.core5.http.ProtocolVersion;
+import org.hamcrest.BaseMatcher;
+import org.hamcrest.Description;
+import org.hamcrest.Matcher;
+import org.hamcrest.MatcherAssert;
+import org.junit.Assert;
+import org.junit.Test;
+import org.mockito.ArgumentMatchers;
+import org.mockito.Mockito;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
 import static org.apache.hc.core5.testing.framework.ClientPOJOAdapter.BODY;
 import static org.apache.hc.core5.testing.framework.ClientPOJOAdapter.CONTENT_TYPE;
 import static org.apache.hc.core5.testing.framework.ClientPOJOAdapter.HEADERS;
@@ -39,22 +56,6 @@ import static org.apache.hc.core5.testing.framework.ClientPOJOAdapter.REQUEST;
 import static org.apache.hc.core5.testing.framework.ClientPOJOAdapter.RESPONSE;
 import static org.apache.hc.core5.testing.framework.ClientPOJOAdapter.STATUS;
 
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.hc.core5.http.ContentType;
-import org.apache.hc.core5.http.HttpVersion;
-import org.apache.hc.core5.http.ProtocolVersion;
-import org.hamcrest.BaseMatcher;
-import org.hamcrest.Description;
-import org.hamcrest.Matcher;
-import org.junit.Assert;
-import org.junit.Test;
-import org.mockito.ArgumentMatchers;
-import org.mockito.Mockito;
-
 public class TestTestingFramework {
 
     @Test
@@ -179,7 +180,7 @@ public class TestTestingFramework {
                                    final Map<String, Object> request,
                                    final TestingFrameworkRequestHandler requestHandler,
                                    final Map<String, Object> responseExpectations) throws TestingFrameworkException {
-                Assert.assertThat(defaultURI, matchesDefaultURI());
+                MatcherAssert.assertThat(defaultURI, matchesDefaultURI());
 
                 Assert.assertNotNull("request should not be null", request);
 
diff --git a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2AlpnTest.java b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2AlpnTest.java
index 76e8d9a..dbb91fe 100644
--- a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2AlpnTest.java
+++ b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2AlpnTest.java
@@ -27,15 +27,6 @@
 
 package org.apache.hc.core5.testing.nio;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.net.InetSocketAddress;
-import java.util.Arrays;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
-
 import org.apache.hc.core5.function.Supplier;
 import org.apache.hc.core5.http.ContentType;
 import org.apache.hc.core5.http.HttpHost;
@@ -65,7 +56,7 @@ import org.apache.hc.core5.testing.SSLTestContexts;
 import org.apache.hc.core5.util.ReflectionUtils;
 import org.apache.hc.core5.util.Timeout;
 import org.hamcrest.CoreMatchers;
-import org.junit.Assert;
+import org.hamcrest.MatcherAssert;
 import org.junit.Assume;
 import org.junit.BeforeClass;
 import org.junit.Rule;
@@ -77,6 +68,15 @@ import org.junit.runners.Parameterized.Parameters;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.net.InetSocketAddress;
+import java.util.Arrays;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
 @RunWith(Parameterized.class)
 public class H2AlpnTest {
     private final Logger log = LoggerFactory.getLogger(getClass());
@@ -204,10 +204,10 @@ public class H2AlpnTest {
         }
 
         assertTrue("h2 negotiation was disabled, but h2 was negotiated", h2Allowed);
-        Assert.assertThat(message1, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(message1, CoreMatchers.notNullValue());
         final HttpResponse response1 = message1.getHead();
-        Assert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+        MatcherAssert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
         final String body1 = message1.getBody();
-        Assert.assertThat(body1, CoreMatchers.equalTo("some stuff"));
+        MatcherAssert.assertThat(body1, CoreMatchers.equalTo("some stuff"));
     }
 }
diff --git a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2IntegrationTest.java b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2IntegrationTest.java
index 35b1a66..e8785ba 100644
--- a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2IntegrationTest.java
+++ b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2IntegrationTest.java
@@ -27,39 +27,6 @@
 
 package org.apache.hc.core5.testing.nio;
 
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.InterruptedIOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.net.InetSocketAddress;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.nio.ByteBuffer;
-import java.nio.charset.Charset;
-import java.nio.charset.StandardCharsets;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Queue;
-import java.util.StringTokenizer;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-import java.util.concurrent.LinkedBlockingDeque;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicReference;
-
 import org.apache.hc.core5.function.Callback;
 import org.apache.hc.core5.function.Decorator;
 import org.apache.hc.core5.function.Supplier;
@@ -125,6 +92,7 @@ import org.apache.hc.core5.util.TextUtils;
 import org.apache.hc.core5.util.TimeValue;
 import org.apache.hc.core5.util.Timeout;
 import org.hamcrest.CoreMatchers;
+import org.hamcrest.MatcherAssert;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -134,6 +102,39 @@ import org.junit.runners.Parameterized;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.InterruptedIOException;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.net.InetSocketAddress;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Queue;
+import java.util.StringTokenizer;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.LinkedBlockingDeque;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
+
 @RunWith(Parameterized.class)
 public class H2IntegrationTest extends InternalH2ServerTestBase {
 
@@ -1048,11 +1049,11 @@ public class H2IntegrationTest extends InternalH2ServerTestBase {
             future.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
             Assert.fail("ExecutionException is expected");
         } catch (final ExecutionException ex) {
-            Assert.assertThat(ex.getCause(), CoreMatchers.instanceOf(ProtocolException.class));
+            MatcherAssert.assertThat(ex.getCause(), CoreMatchers.instanceOf(ProtocolException.class));
         }
 
         final EndpointDetails endpointDetails = coreContext.getEndpointDetails();
-        Assert.assertThat(endpointDetails.getRequestCount(), CoreMatchers.equalTo(0L));
+        MatcherAssert.assertThat(endpointDetails.getRequestCount(), CoreMatchers.equalTo(0L));
     }
 
     @Test
diff --git a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2ProtocolNegotiationTest.java b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2ProtocolNegotiationTest.java
index b77d390..21d82bd 100644
--- a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2ProtocolNegotiationTest.java
+++ b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2ProtocolNegotiationTest.java
@@ -27,11 +27,6 @@
 
 package org.apache.hc.core5.testing.nio;
 
-import java.net.InetSocketAddress;
-import java.util.concurrent.Future;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
 import org.apache.hc.core5.function.Supplier;
 import org.apache.hc.core5.http.ContentType;
 import org.apache.hc.core5.http.HttpHost;
@@ -63,7 +58,7 @@ import org.apache.hc.core5.testing.classic.LoggingConnPoolListener;
 import org.apache.hc.core5.util.ReflectionUtils;
 import org.apache.hc.core5.util.Timeout;
 import org.hamcrest.CoreMatchers;
-import org.junit.Assert;
+import org.hamcrest.MatcherAssert;
 import org.junit.Assume;
 import org.junit.Before;
 import org.junit.BeforeClass;
@@ -73,6 +68,11 @@ import org.junit.rules.ExternalResource;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.net.InetSocketAddress;
+import java.util.concurrent.Future;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
 public class H2ProtocolNegotiationTest {
 
     private static final Timeout TIMEOUT = Timeout.ofSeconds(30);
@@ -184,10 +184,10 @@ public class H2ProtocolNegotiationTest {
                         new StringAsyncEntityProducer("some stuff", ContentType.TEXT_PLAIN)),
                 new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), null);
         final Message<HttpResponse, String> message1 = resultFuture1.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-        Assert.assertThat(message1, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(message1, CoreMatchers.notNullValue());
         final HttpResponse response1 = message1.getHead();
-        Assert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
-        Assert.assertThat(response1.getVersion(), CoreMatchers.<ProtocolVersion>equalTo(HttpVersion.HTTP_1_1));
+        MatcherAssert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+        MatcherAssert.assertThat(response1.getVersion(), CoreMatchers.<ProtocolVersion>equalTo(HttpVersion.HTTP_1_1));
     }
 
     @Test
@@ -207,10 +207,10 @@ public class H2ProtocolNegotiationTest {
                         new StringAsyncEntityProducer("some stuff", ContentType.TEXT_PLAIN)),
                 new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), null);
         final Message<HttpResponse, String> message1 = resultFuture1.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-        Assert.assertThat(message1, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(message1, CoreMatchers.notNullValue());
         final HttpResponse response1 = message1.getHead();
-        Assert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
-        Assert.assertThat(response1.getVersion(), CoreMatchers.<ProtocolVersion>equalTo(HttpVersion.HTTP_2));
+        MatcherAssert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+        MatcherAssert.assertThat(response1.getVersion(), CoreMatchers.<ProtocolVersion>equalTo(HttpVersion.HTTP_2));
     }
 
     @Test
@@ -230,14 +230,14 @@ public class H2ProtocolNegotiationTest {
                         new StringAsyncEntityProducer("some stuff", ContentType.TEXT_PLAIN)),
                 new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), null);
         final Message<HttpResponse, String> message1 = resultFuture1.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-        Assert.assertThat(message1, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(message1, CoreMatchers.notNullValue());
         final HttpResponse response1 = message1.getHead();
-        Assert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+        MatcherAssert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
 
         if (isAlpnSupported()) {
-            Assert.assertThat(response1.getVersion(), CoreMatchers.<ProtocolVersion>equalTo(HttpVersion.HTTP_2));
+            MatcherAssert.assertThat(response1.getVersion(), CoreMatchers.<ProtocolVersion>equalTo(HttpVersion.HTTP_2));
         } else {
-            Assert.assertThat(response1.getVersion(), CoreMatchers.<ProtocolVersion>equalTo(HttpVersion.HTTP_1_1));
+            MatcherAssert.assertThat(response1.getVersion(), CoreMatchers.<ProtocolVersion>equalTo(HttpVersion.HTTP_1_1));
         }
     }
 
diff --git a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2ServerAndMultiplexingRequesterTest.java b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2ServerAndMultiplexingRequesterTest.java
index 6a60017..e7c0504 100644
--- a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2ServerAndMultiplexingRequesterTest.java
+++ b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2ServerAndMultiplexingRequesterTest.java
@@ -27,15 +27,6 @@
 
 package org.apache.hc.core5.testing.nio;
 
-import java.net.InetSocketAddress;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.Queue;
-import java.util.Random;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.Future;
-
 import org.apache.hc.core5.concurrent.Cancellable;
 import org.apache.hc.core5.concurrent.FutureCallback;
 import org.apache.hc.core5.function.Supplier;
@@ -67,7 +58,7 @@ import org.apache.hc.core5.util.ReflectionUtils;
 import org.apache.hc.core5.util.TimeValue;
 import org.apache.hc.core5.util.Timeout;
 import org.hamcrest.CoreMatchers;
-import org.junit.Assert;
+import org.hamcrest.MatcherAssert;
 import org.junit.Assume;
 import org.junit.Before;
 import org.junit.BeforeClass;
@@ -79,6 +70,15 @@ import org.junit.runners.Parameterized;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.net.InetSocketAddress;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.Queue;
+import java.util.Random;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.Future;
+
 @RunWith(Parameterized.class)
 public class H2ServerAndMultiplexingRequesterTest {
 
@@ -197,33 +197,33 @@ public class H2ServerAndMultiplexingRequesterTest {
                         new StringAsyncEntityProducer("some stuff", ContentType.TEXT_PLAIN)),
                 new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), TIMEOUT, null);
         final Message<HttpResponse, String> message1 = resultFuture1.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-        Assert.assertThat(message1, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(message1, CoreMatchers.notNullValue());
         final HttpResponse response1 = message1.getHead();
-        Assert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+        MatcherAssert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
         final String body1 = message1.getBody();
-        Assert.assertThat(body1, CoreMatchers.equalTo("some stuff"));
+        MatcherAssert.assertThat(body1, CoreMatchers.equalTo("some stuff"));
 
         final Future<Message<HttpResponse, String>> resultFuture2 = requester.execute(
                 new BasicRequestProducer(Method.POST, target, "/other-stuff",
                         new StringAsyncEntityProducer("some other stuff", ContentType.TEXT_PLAIN)),
                 new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), TIMEOUT, null);
         final Message<HttpResponse, String> message2 = resultFuture2.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-        Assert.assertThat(message2, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(message2, CoreMatchers.notNullValue());
         final HttpResponse response2 = message2.getHead();
-        Assert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+        MatcherAssert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
         final String body2 = message2.getBody();
-        Assert.assertThat(body2, CoreMatchers.equalTo("some other stuff"));
+        MatcherAssert.assertThat(body2, CoreMatchers.equalTo("some other stuff"));
 
         final Future<Message<HttpResponse, String>> resultFuture3 = requester.execute(
                 new BasicRequestProducer(Method.POST, target, "/more-stuff",
                         new StringAsyncEntityProducer("some more stuff", ContentType.TEXT_PLAIN)),
                 new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), TIMEOUT, null);
         final Message<HttpResponse, String> message3 = resultFuture3.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-        Assert.assertThat(message3, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(message3, CoreMatchers.notNullValue());
         final HttpResponse response3 = message3.getHead();
-        Assert.assertThat(response3.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+        MatcherAssert.assertThat(response3.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
         final String body3 = message3.getBody();
-        Assert.assertThat(body3, CoreMatchers.equalTo("some more stuff"));
+        MatcherAssert.assertThat(body3, CoreMatchers.equalTo("some more stuff"));
     }
 
     @Test
@@ -253,11 +253,11 @@ public class H2ServerAndMultiplexingRequesterTest {
         while (!queue.isEmpty()) {
             final Future<Message<HttpResponse, String>> resultFuture = queue.remove();
             final Message<HttpResponse, String> message = resultFuture.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-            Assert.assertThat(message, CoreMatchers.notNullValue());
+            MatcherAssert.assertThat(message, CoreMatchers.notNullValue());
             final HttpResponse response = message.getHead();
-            Assert.assertThat(response.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+            MatcherAssert.assertThat(response.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
             final String body = message.getBody();
-            Assert.assertThat(body, CoreMatchers.containsString("stuff"));
+            MatcherAssert.assertThat(body, CoreMatchers.containsString("stuff"));
         }
     }
 
@@ -276,11 +276,11 @@ public class H2ServerAndMultiplexingRequesterTest {
                         new StringAsyncEntityProducer("some stuff", ContentType.TEXT_PLAIN)),
                 new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), TIMEOUT, null);
         final Message<HttpResponse, String> message1 = resultFuture1.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-        Assert.assertThat(message1, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(message1, CoreMatchers.notNullValue());
         final HttpResponse response1 = message1.getHead();
-        Assert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+        MatcherAssert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
         final String body1 = message1.getBody();
-        Assert.assertThat(body1, CoreMatchers.equalTo("some stuff"));
+        MatcherAssert.assertThat(body1, CoreMatchers.equalTo("some stuff"));
 
         Thread.sleep(100);
 
@@ -289,11 +289,11 @@ public class H2ServerAndMultiplexingRequesterTest {
                         new StringAsyncEntityProducer("some other stuff", ContentType.TEXT_PLAIN)),
                 new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), TIMEOUT, null);
         final Message<HttpResponse, String> message2 = resultFuture2.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-        Assert.assertThat(message2, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(message2, CoreMatchers.notNullValue());
         final HttpResponse response2 = message2.getHead();
-        Assert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+        MatcherAssert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
         final String body2 = message2.getBody();
-        Assert.assertThat(body2, CoreMatchers.equalTo("some other stuff"));
+        MatcherAssert.assertThat(body2, CoreMatchers.equalTo("some other stuff"));
 
         Thread.sleep(100);
 
@@ -302,11 +302,11 @@ public class H2ServerAndMultiplexingRequesterTest {
                         new StringAsyncEntityProducer("some more stuff", ContentType.TEXT_PLAIN)),
                 new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), TIMEOUT, null);
         final Message<HttpResponse, String> message3 = resultFuture3.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-        Assert.assertThat(message3, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(message3, CoreMatchers.notNullValue());
         final HttpResponse response3 = message3.getHead();
-        Assert.assertThat(response3.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+        MatcherAssert.assertThat(response3.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
         final String body3 = message3.getBody();
-        Assert.assertThat(body3, CoreMatchers.equalTo("some more stuff"));
+        MatcherAssert.assertThat(body3, CoreMatchers.equalTo("some more stuff"));
     }
 
     @Test
@@ -350,7 +350,7 @@ public class H2ServerAndMultiplexingRequesterTest {
             Thread.sleep(random.nextInt(10));
             cancellable.cancel();
         }
-        Assert.assertThat(countDownLatch.await(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit()), CoreMatchers.equalTo(true));
+        MatcherAssert.assertThat(countDownLatch.await(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit()), CoreMatchers.equalTo(true));
     }
 
 }
diff --git a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2ServerAndRequesterTest.java b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2ServerAndRequesterTest.java
index fc8a0d0..931f1a7 100644
--- a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2ServerAndRequesterTest.java
+++ b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2ServerAndRequesterTest.java
@@ -27,13 +27,6 @@
 
 package org.apache.hc.core5.testing.nio;
 
-import java.net.InetSocketAddress;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.Queue;
-import java.util.concurrent.Future;
-
 import org.apache.hc.core5.function.Supplier;
 import org.apache.hc.core5.http.ContentType;
 import org.apache.hc.core5.http.HttpHost;
@@ -64,7 +57,7 @@ import org.apache.hc.core5.testing.classic.LoggingConnPoolListener;
 import org.apache.hc.core5.util.ReflectionUtils;
 import org.apache.hc.core5.util.Timeout;
 import org.hamcrest.CoreMatchers;
-import org.junit.Assert;
+import org.hamcrest.MatcherAssert;
 import org.junit.Assume;
 import org.junit.Before;
 import org.junit.BeforeClass;
@@ -76,6 +69,13 @@ import org.junit.runners.Parameterized;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.net.InetSocketAddress;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.Queue;
+import java.util.concurrent.Future;
+
 @RunWith(Parameterized.class)
 public class H2ServerAndRequesterTest {
 
@@ -200,33 +200,33 @@ public class H2ServerAndRequesterTest {
                         new StringAsyncEntityProducer("some stuff", ContentType.TEXT_PLAIN)),
                 new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), TIMEOUT, null);
         final Message<HttpResponse, String> message1 = resultFuture1.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-        Assert.assertThat(message1, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(message1, CoreMatchers.notNullValue());
         final HttpResponse response1 = message1.getHead();
-        Assert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+        MatcherAssert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
         final String body1 = message1.getBody();
-        Assert.assertThat(body1, CoreMatchers.equalTo("some stuff"));
+        MatcherAssert.assertThat(body1, CoreMatchers.equalTo("some stuff"));
 
         final Future<Message<HttpResponse, String>> resultFuture2 = requester.execute(
                 new BasicRequestProducer(Method.POST, target, "/other-stuff",
                         new StringAsyncEntityProducer("some other stuff", ContentType.TEXT_PLAIN)),
                 new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), TIMEOUT, null);
         final Message<HttpResponse, String> message2 = resultFuture2.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-        Assert.assertThat(message2, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(message2, CoreMatchers.notNullValue());
         final HttpResponse response2 = message2.getHead();
-        Assert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+        MatcherAssert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
         final String body2 = message2.getBody();
-        Assert.assertThat(body2, CoreMatchers.equalTo("some other stuff"));
+        MatcherAssert.assertThat(body2, CoreMatchers.equalTo("some other stuff"));
 
         final Future<Message<HttpResponse, String>> resultFuture3 = requester.execute(
                 new BasicRequestProducer(Method.POST, target, "/more-stuff",
                         new StringAsyncEntityProducer("some more stuff", ContentType.TEXT_PLAIN)),
                 new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), TIMEOUT, null);
         final Message<HttpResponse, String> message3 = resultFuture3.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-        Assert.assertThat(message3, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(message3, CoreMatchers.notNullValue());
         final HttpResponse response3 = message3.getHead();
-        Assert.assertThat(response3.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+        MatcherAssert.assertThat(response3.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
         final String body3 = message3.getBody();
-        Assert.assertThat(body3, CoreMatchers.equalTo("some more stuff"));
+        MatcherAssert.assertThat(body3, CoreMatchers.equalTo("some more stuff"));
     }
 
     @Test
@@ -247,33 +247,33 @@ public class H2ServerAndRequesterTest {
                             new StringAsyncEntityProducer("some stuff", ContentType.TEXT_PLAIN)),
                     new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), null);
             final Message<HttpResponse, String> message1 = resultFuture1.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-            Assert.assertThat(message1, CoreMatchers.notNullValue());
+            MatcherAssert.assertThat(message1, CoreMatchers.notNullValue());
             final HttpResponse response1 = message1.getHead();
-            Assert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+            MatcherAssert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
             final String body1 = message1.getBody();
-            Assert.assertThat(body1, CoreMatchers.equalTo("some stuff"));
+            MatcherAssert.assertThat(body1, CoreMatchers.equalTo("some stuff"));
 
             final Future<Message<HttpResponse, String>> resultFuture2 = endpoint.execute(
                     new BasicRequestProducer(Method.POST, target, "/other-stuff",
                             new StringAsyncEntityProducer("some other stuff", ContentType.TEXT_PLAIN)),
                     new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), null);
             final Message<HttpResponse, String> message2 = resultFuture2.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-            Assert.assertThat(message2, CoreMatchers.notNullValue());
+            MatcherAssert.assertThat(message2, CoreMatchers.notNullValue());
             final HttpResponse response2 = message2.getHead();
-            Assert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+            MatcherAssert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
             final String body2 = message2.getBody();
-            Assert.assertThat(body2, CoreMatchers.equalTo("some other stuff"));
+            MatcherAssert.assertThat(body2, CoreMatchers.equalTo("some other stuff"));
 
             final Future<Message<HttpResponse, String>> resultFuture3 = endpoint.execute(
                     new BasicRequestProducer(Method.POST, target, "/more-stuff",
                             new StringAsyncEntityProducer("some more stuff", ContentType.TEXT_PLAIN)),
                     new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), null);
             final Message<HttpResponse, String> message3 = resultFuture3.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-            Assert.assertThat(message3, CoreMatchers.notNullValue());
+            MatcherAssert.assertThat(message3, CoreMatchers.notNullValue());
             final HttpResponse response3 = message3.getHead();
-            Assert.assertThat(response3.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+            MatcherAssert.assertThat(response3.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
             final String body3 = message3.getBody();
-            Assert.assertThat(body3, CoreMatchers.equalTo("some more stuff"));
+            MatcherAssert.assertThat(body3, CoreMatchers.equalTo("some more stuff"));
 
         } finally {
             endpoint.releaseAndReuse();
@@ -311,11 +311,11 @@ public class H2ServerAndRequesterTest {
             while (!queue.isEmpty()) {
                 final Future<Message<HttpResponse, String>> resultFuture = queue.remove();
                 final Message<HttpResponse, String> message = resultFuture.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-                Assert.assertThat(message, CoreMatchers.notNullValue());
+                MatcherAssert.assertThat(message, CoreMatchers.notNullValue());
                 final HttpResponse response = message.getHead();
-                Assert.assertThat(response.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+                MatcherAssert.assertThat(response.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
                 final String body = message.getBody();
-                Assert.assertThat(body, CoreMatchers.containsString("stuff"));
+                MatcherAssert.assertThat(body, CoreMatchers.containsString("stuff"));
             }
 
         } finally {
diff --git a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2TLSIntegrationTest.java b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2TLSIntegrationTest.java
index 0833c57..6c1e09b 100644
--- a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2TLSIntegrationTest.java
+++ b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/H2TLSIntegrationTest.java
@@ -27,17 +27,6 @@
 
 package org.apache.hc.core5.testing.nio;
 
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
-import java.util.concurrent.atomic.AtomicReference;
-
-import javax.net.ssl.SSLEngine;
-import javax.net.ssl.SSLException;
-import javax.net.ssl.SSLHandshakeException;
-import javax.net.ssl.SSLSession;
-
 import org.apache.hc.core5.function.Supplier;
 import org.apache.hc.core5.http.ContentType;
 import org.apache.hc.core5.http.HttpHost;
@@ -72,11 +61,22 @@ import org.apache.hc.core5.testing.SSLTestContexts;
 import org.apache.hc.core5.testing.classic.LoggingConnPoolListener;
 import org.apache.hc.core5.util.Timeout;
 import org.hamcrest.CoreMatchers;
+import org.hamcrest.MatcherAssert;
 import org.junit.Assert;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExternalResource;
 
+import javax.net.ssl.SSLEngine;
+import javax.net.ssl.SSLException;
+import javax.net.ssl.SSLHandshakeException;
+import javax.net.ssl.SSLSession;
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import java.util.concurrent.atomic.AtomicReference;
+
 public class H2TLSIntegrationTest {
 
     private static final Timeout TIMEOUT = Timeout.ofSeconds(30);
@@ -176,16 +176,16 @@ public class H2TLSIntegrationTest {
                         new StringAsyncEntityProducer("some stuff", ContentType.TEXT_PLAIN)),
                 new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), TIMEOUT, null);
         final Message<HttpResponse, String> message1 = resultFuture1.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-        Assert.assertThat(message1, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(message1, CoreMatchers.notNullValue());
         final HttpResponse response1 = message1.getHead();
-        Assert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+        MatcherAssert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
         final String body1 = message1.getBody();
-        Assert.assertThat(body1, CoreMatchers.equalTo("some stuff"));
+        MatcherAssert.assertThat(body1, CoreMatchers.equalTo("some stuff"));
 
         final SSLSession sslSession = sslSessionRef.getAndSet(null);
         final ProtocolVersion tlsVersion = TLS.parse(sslSession.getProtocol());
-        Assert.assertThat(tlsVersion.greaterEquals(TLS.V_1_2.version), CoreMatchers.equalTo(true));
-        Assert.assertThat(sslSession.getPeerPrincipal().getName(),
+        MatcherAssert.assertThat(tlsVersion.greaterEquals(TLS.V_1_2.version), CoreMatchers.equalTo(true));
+        MatcherAssert.assertThat(sslSession.getPeerPrincipal().getName(),
                 CoreMatchers.equalTo("CN=localhost,OU=Apache HttpComponents,O=Apache Software Foundation"));
     }
 
@@ -241,7 +241,7 @@ public class H2TLSIntegrationTest {
             Assert.fail("ExecutionException expected");
         } catch (final ExecutionException ex) {
             final Throwable cause = ex.getCause();
-            Assert.assertThat(cause, CoreMatchers.<Throwable>instanceOf(SSLHandshakeException.class));
+            MatcherAssert.assertThat(cause, CoreMatchers.<Throwable>instanceOf(SSLHandshakeException.class));
         }
     }
 
@@ -306,7 +306,7 @@ public class H2TLSIntegrationTest {
             Assert.fail("ExecutionException expected");
         } catch (final ExecutionException ex) {
             final Throwable cause = ex.getCause();
-            Assert.assertThat(cause, CoreMatchers.<Throwable>instanceOf(IOException.class));
+            MatcherAssert.assertThat(cause, CoreMatchers.<Throwable>instanceOf(IOException.class));
         }
     }
 
@@ -371,7 +371,7 @@ public class H2TLSIntegrationTest {
             Assert.fail("ExecutionException expected");
         } catch (final ExecutionException ex) {
             final Throwable cause = ex.getCause();
-            Assert.assertThat(cause, CoreMatchers.<Throwable>instanceOf(IOException.class));
+            MatcherAssert.assertThat(cause, CoreMatchers.<Throwable>instanceOf(IOException.class));
         }
     }
 
@@ -454,7 +454,7 @@ public class H2TLSIntegrationTest {
                     Assert.fail("ExecutionException expected");
                 } catch (final ExecutionException ex) {
                     final Throwable cause = ex.getCause();
-                    Assert.assertThat(cause, CoreMatchers.<Throwable>instanceOf(IOException.class));
+                    MatcherAssert.assertThat(cause, CoreMatchers.<Throwable>instanceOf(IOException.class));
                 }
             } finally {
                 server.close(CloseMode.IMMEDIATE);
diff --git a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http1AuthenticationTest.java b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http1AuthenticationTest.java
index 8d12aa1..859fdbb 100644
--- a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http1AuthenticationTest.java
+++ b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http1AuthenticationTest.java
@@ -27,13 +27,6 @@
 
 package org.apache.hc.core5.testing.nio;
 
-import java.net.InetSocketAddress;
-import java.nio.charset.StandardCharsets;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Random;
-import java.util.concurrent.Future;
-
 import org.apache.hc.core5.function.Supplier;
 import org.apache.hc.core5.http.ContentType;
 import org.apache.hc.core5.http.HttpException;
@@ -67,7 +60,7 @@ import org.apache.hc.core5.reactor.ListenerEndpoint;
 import org.apache.hc.core5.testing.classic.LoggingConnPoolListener;
 import org.apache.hc.core5.util.Timeout;
 import org.hamcrest.CoreMatchers;
-import org.junit.Assert;
+import org.hamcrest.MatcherAssert;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExternalResource;
@@ -76,6 +69,13 @@ import org.junit.runners.Parameterized;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.net.InetSocketAddress;
+import java.nio.charset.StandardCharsets;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Random;
+import java.util.concurrent.Future;
+
 @RunWith(Parameterized.class)
 public class Http1AuthenticationTest {
 
@@ -217,11 +217,11 @@ public class Http1AuthenticationTest {
                 new BasicRequestProducer(request1, null),
                 new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), TIMEOUT, null);
         final Message<HttpResponse, String> message1 = resultFuture1.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-        Assert.assertThat(message1, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(message1, CoreMatchers.notNullValue());
         final HttpResponse response1 = message1.getHead();
-        Assert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_UNAUTHORIZED));
+        MatcherAssert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_UNAUTHORIZED));
         final String body1 = message1.getBody();
-        Assert.assertThat(body1, CoreMatchers.equalTo("You shall not pass!!!"));
+        MatcherAssert.assertThat(body1, CoreMatchers.equalTo("You shall not pass!!!"));
 
         final HttpRequest request2 = new BasicHttpRequest(Method.GET, target, "/stuff");
         request2.setHeader(HttpHeaders.AUTHORIZATION, "let me pass");
@@ -229,11 +229,11 @@ public class Http1AuthenticationTest {
                 new BasicRequestProducer(request2, null),
                 new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), TIMEOUT, null);
         final Message<HttpResponse, String> message2 = resultFuture2.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-        Assert.assertThat(message2, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(message2, CoreMatchers.notNullValue());
         final HttpResponse response2 = message2.getHead();
-        Assert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+        MatcherAssert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
         final String body2 = message2.getBody();
-        Assert.assertThat(body2, CoreMatchers.equalTo(""));
+        MatcherAssert.assertThat(body2, CoreMatchers.equalTo(""));
     }
 
     @Test
@@ -255,11 +255,11 @@ public class Http1AuthenticationTest {
                 new BasicRequestProducer(request1, AsyncEntityProducers.create(stuff, ContentType.TEXT_PLAIN)),
                 new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), TIMEOUT, null);
         final Message<HttpResponse, String> message1 = resultFuture1.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-        Assert.assertThat(message1, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(message1, CoreMatchers.notNullValue());
         final HttpResponse response1 = message1.getHead();
-        Assert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_UNAUTHORIZED));
+        MatcherAssert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_UNAUTHORIZED));
         final String body1 = message1.getBody();
-        Assert.assertThat(body1, CoreMatchers.equalTo("You shall not pass!!!"));
+        MatcherAssert.assertThat(body1, CoreMatchers.equalTo("You shall not pass!!!"));
 
         final HttpRequest request2 = new BasicHttpRequest(Method.POST, target, "/stuff");
         request2.setHeader(HttpHeaders.AUTHORIZATION, "let me pass");
@@ -267,11 +267,11 @@ public class Http1AuthenticationTest {
                 new BasicRequestProducer(request2, AsyncEntityProducers.create(stuff, ContentType.TEXT_PLAIN)),
                 new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), TIMEOUT, null);
         final Message<HttpResponse, String> message2 = resultFuture2.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-        Assert.assertThat(message2, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(message2, CoreMatchers.notNullValue());
         final HttpResponse response2 = message2.getHead();
-        Assert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+        MatcherAssert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
         final String body2 = message2.getBody();
-        Assert.assertThat(body2, CoreMatchers.equalTo(new String(stuff, StandardCharsets.US_ASCII)));
+        MatcherAssert.assertThat(body2, CoreMatchers.equalTo(new String(stuff, StandardCharsets.US_ASCII)));
     }
 
     @Test
@@ -295,11 +295,11 @@ public class Http1AuthenticationTest {
                 new BasicRequestProducer(request1, AsyncEntityProducers.create(stuff, ContentType.TEXT_PLAIN)),
                 new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), TIMEOUT, null);
         final Message<HttpResponse, String> message1 = resultFuture1.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-        Assert.assertThat(message1, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(message1, CoreMatchers.notNullValue());
         final HttpResponse response1 = message1.getHead();
-        Assert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_UNAUTHORIZED));
+        MatcherAssert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_UNAUTHORIZED));
         final String body1 = message1.getBody();
-        Assert.assertThat(body1, CoreMatchers.equalTo("You shall not pass!!!"));
+        MatcherAssert.assertThat(body1, CoreMatchers.equalTo("You shall not pass!!!"));
 
         final HttpRequest request2 = new BasicHttpRequest(Method.POST, target, "/stuff");
         request2.setVersion(HttpVersion.HTTP_1_0);
@@ -308,11 +308,11 @@ public class Http1AuthenticationTest {
                 new BasicRequestProducer(request2, AsyncEntityProducers.create(stuff, ContentType.TEXT_PLAIN)),
                 new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), TIMEOUT, null);
         final Message<HttpResponse, String> message2 = resultFuture2.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-        Assert.assertThat(message2, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(message2, CoreMatchers.notNullValue());
         final HttpResponse response2 = message2.getHead();
-        Assert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+        MatcherAssert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
         final String body2 = message2.getBody();
-        Assert.assertThat(body2, CoreMatchers.equalTo(new String(stuff, StandardCharsets.US_ASCII)));
+        MatcherAssert.assertThat(body2, CoreMatchers.equalTo(new String(stuff, StandardCharsets.US_ASCII)));
     }
 
 }
diff --git a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http1ServerAndRequesterTest.java b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http1ServerAndRequesterTest.java
index 2d961d7..9cd2bcc 100644
--- a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http1ServerAndRequesterTest.java
+++ b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http1ServerAndRequesterTest.java
@@ -27,14 +27,6 @@
 
 package org.apache.hc.core5.testing.nio;
 
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.Queue;
-import java.util.concurrent.Future;
-
 import org.apache.hc.core5.function.Supplier;
 import org.apache.hc.core5.http.ContentType;
 import org.apache.hc.core5.http.EntityDetails;
@@ -76,7 +68,7 @@ import org.apache.hc.core5.testing.SSLTestContexts;
 import org.apache.hc.core5.testing.classic.LoggingConnPoolListener;
 import org.apache.hc.core5.util.Timeout;
 import org.hamcrest.CoreMatchers;
-import org.junit.Assert;
+import org.hamcrest.MatcherAssert;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExternalResource;
@@ -85,6 +77,14 @@ import org.junit.runners.Parameterized;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.Queue;
+import java.util.concurrent.Future;
+
 @RunWith(Parameterized.class)
 public class Http1ServerAndRequesterTest {
 
@@ -228,33 +228,33 @@ public class Http1ServerAndRequesterTest {
                         new StringAsyncEntityProducer("some stuff", ContentType.TEXT_PLAIN)),
                 new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), TIMEOUT, null);
         final Message<HttpResponse, String> message1 = resultFuture1.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-        Assert.assertThat(message1, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(message1, CoreMatchers.notNullValue());
         final HttpResponse response1 = message1.getHead();
-        Assert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+        MatcherAssert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
         final String body1 = message1.getBody();
-        Assert.assertThat(body1, CoreMatchers.equalTo("some stuff"));
+        MatcherAssert.assertThat(body1, CoreMatchers.equalTo("some stuff"));
 
         final Future<Message<HttpResponse, String>> resultFuture2 = requester.execute(
                 new BasicRequestProducer(Method.POST, target, "/other-stuff",
                         new StringAsyncEntityProducer("some other stuff", ContentType.TEXT_PLAIN)),
                 new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), TIMEOUT, null);
         final Message<HttpResponse, String> message2 = resultFuture2.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-        Assert.assertThat(message2, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(message2, CoreMatchers.notNullValue());
         final HttpResponse response2 = message2.getHead();
-        Assert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+        MatcherAssert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
         final String body2 = message2.getBody();
-        Assert.assertThat(body2, CoreMatchers.equalTo("some other stuff"));
+        MatcherAssert.assertThat(body2, CoreMatchers.equalTo("some other stuff"));
 
         final Future<Message<HttpResponse, String>> resultFuture3 = requester.execute(
                 new BasicRequestProducer(Method.POST, target, "/more-stuff",
                         new StringAsyncEntityProducer("some more stuff", ContentType.TEXT_PLAIN)),
                 new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), TIMEOUT, null);
         final Message<HttpResponse, String> message3 = resultFuture3.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-        Assert.assertThat(message3, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(message3, CoreMatchers.notNullValue());
         final HttpResponse response3 = message3.getHead();
-        Assert.assertThat(response3.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+        MatcherAssert.assertThat(response3.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
         final String body3 = message3.getBody();
-        Assert.assertThat(body3, CoreMatchers.equalTo("some more stuff"));
+        MatcherAssert.assertThat(body3, CoreMatchers.equalTo("some more stuff"));
     }
 
     @Test
@@ -271,33 +271,33 @@ public class Http1ServerAndRequesterTest {
                         new StringAsyncEntityProducer("some stuff", ContentType.TEXT_PLAIN)),
                 new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), TIMEOUT, null);
         final Message<HttpResponse, String> message1 = resultFuture1.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-        Assert.assertThat(message1, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(message1, CoreMatchers.notNullValue());
         final HttpResponse response1 = message1.getHead();
-        Assert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+        MatcherAssert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
         final String body1 = message1.getBody();
-        Assert.assertThat(body1, CoreMatchers.equalTo("some stuff"));
+        MatcherAssert.assertThat(body1, CoreMatchers.equalTo("some stuff"));
 
         final Future<Message<HttpResponse, String>> resultFuture2 = requester.execute(
                 new BasicRequestProducer(Method.POST, target, "/no-keep-alive/other-stuff",
                         new StringAsyncEntityProducer("some other stuff", ContentType.TEXT_PLAIN)),
                 new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), TIMEOUT, null);
         final Message<HttpResponse, String> message2 = resultFuture2.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-        Assert.assertThat(message2, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(message2, CoreMatchers.notNullValue());
         final HttpResponse response2 = message2.getHead();
-        Assert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+        MatcherAssert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
         final String body2 = message2.getBody();
-        Assert.assertThat(body2, CoreMatchers.equalTo("some other stuff"));
+        MatcherAssert.assertThat(body2, CoreMatchers.equalTo("some other stuff"));
 
         final Future<Message<HttpResponse, String>> resultFuture3 = requester.execute(
                 new BasicRequestProducer(Method.POST, target, "/no-keep-alive/more-stuff",
                         new StringAsyncEntityProducer("some more stuff", ContentType.TEXT_PLAIN)),
                 new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), TIMEOUT, null);
         final Message<HttpResponse, String> message3 = resultFuture3.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-        Assert.assertThat(message3, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(message3, CoreMatchers.notNullValue());
         final HttpResponse response3 = message3.getHead();
-        Assert.assertThat(response3.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+        MatcherAssert.assertThat(response3.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
         final String body3 = message3.getBody();
-        Assert.assertThat(body3, CoreMatchers.equalTo("some more stuff"));
+        MatcherAssert.assertThat(body3, CoreMatchers.equalTo("some more stuff"));
     }
 
     @Test
@@ -318,33 +318,33 @@ public class Http1ServerAndRequesterTest {
                             new StringAsyncEntityProducer("some stuff", ContentType.TEXT_PLAIN)),
                     new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), null);
             final Message<HttpResponse, String> message1 = resultFuture1.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-            Assert.assertThat(message1, CoreMatchers.notNullValue());
+            MatcherAssert.assertThat(message1, CoreMatchers.notNullValue());
             final HttpResponse response1 = message1.getHead();
-            Assert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+            MatcherAssert.assertThat(response1.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
             final String body1 = message1.getBody();
-            Assert.assertThat(body1, CoreMatchers.equalTo("some stuff"));
+            MatcherAssert.assertThat(body1, CoreMatchers.equalTo("some stuff"));
 
             final Future<Message<HttpResponse, String>> resultFuture2 = endpoint.execute(
                     new BasicRequestProducer(Method.POST, target, "/other-stuff",
                             new StringAsyncEntityProducer("some other stuff", ContentType.TEXT_PLAIN)),
                     new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), null);
             final Message<HttpResponse, String> message2 = resultFuture2.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-            Assert.assertThat(message2, CoreMatchers.notNullValue());
+            MatcherAssert.assertThat(message2, CoreMatchers.notNullValue());
             final HttpResponse response2 = message2.getHead();
-            Assert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+            MatcherAssert.assertThat(response2.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
             final String body2 = message2.getBody();
-            Assert.assertThat(body2, CoreMatchers.equalTo("some other stuff"));
+            MatcherAssert.assertThat(body2, CoreMatchers.equalTo("some other stuff"));
 
             final Future<Message<HttpResponse, String>> resultFuture3 = endpoint.execute(
                     new BasicRequestProducer(Method.POST, target, "/more-stuff",
                             new StringAsyncEntityProducer("some more stuff", ContentType.TEXT_PLAIN)),
                     new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), null);
             final Message<HttpResponse, String> message3 = resultFuture3.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-            Assert.assertThat(message3, CoreMatchers.notNullValue());
+            MatcherAssert.assertThat(message3, CoreMatchers.notNullValue());
             final HttpResponse response3 = message3.getHead();
-            Assert.assertThat(response3.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+            MatcherAssert.assertThat(response3.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
             final String body3 = message3.getBody();
-            Assert.assertThat(body3, CoreMatchers.equalTo("some more stuff"));
+            MatcherAssert.assertThat(body3, CoreMatchers.equalTo("some more stuff"));
 
         } finally {
             endpoint.releaseAndReuse();
@@ -382,11 +382,11 @@ public class Http1ServerAndRequesterTest {
             while (!queue.isEmpty()) {
                 final Future<Message<HttpResponse, String>> resultFuture = queue.remove();
                 final Message<HttpResponse, String> message = resultFuture.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-                Assert.assertThat(message, CoreMatchers.notNullValue());
+                MatcherAssert.assertThat(message, CoreMatchers.notNullValue());
                 final HttpResponse response = message.getHead();
-                Assert.assertThat(response.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+                MatcherAssert.assertThat(response.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
                 final String body = message.getBody();
-                Assert.assertThat(body, CoreMatchers.containsString("stuff"));
+                MatcherAssert.assertThat(body, CoreMatchers.containsString("stuff"));
             }
 
         } finally {
@@ -415,10 +415,10 @@ public class Http1ServerAndRequesterTest {
         while (!queue.isEmpty()) {
             final Future<Message<HttpResponse, String>> resultFuture = queue.remove();
             final Message<HttpResponse, String> message = resultFuture.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
-            Assert.assertThat(message, CoreMatchers.notNullValue());
+            MatcherAssert.assertThat(message, CoreMatchers.notNullValue());
             final HttpResponse response = message.getHead();
-            Assert.assertThat(response.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
-            Assert.assertThat(message.getBody(), CoreMatchers.nullValue());
+            MatcherAssert.assertThat(response.getCode(), CoreMatchers.equalTo(HttpStatus.SC_OK));
+            MatcherAssert.assertThat(message.getBody(), CoreMatchers.nullValue());
         }
     }
 
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/concurrent/TestComplexCancellable.java b/httpcore5/src/test/java/org/apache/hc/core5/concurrent/TestComplexCancellable.java
index 8013dd9..9904576 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/concurrent/TestComplexCancellable.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/concurrent/TestComplexCancellable.java
@@ -27,6 +27,7 @@
 package org.apache.hc.core5.concurrent;
 
 import org.hamcrest.CoreMatchers;
+import org.hamcrest.MatcherAssert;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -42,12 +43,12 @@ public class TestComplexCancellable {
         Assert.assertFalse(cancellable.isCancelled());
 
         cancellable.cancel();
-        Assert.assertThat(cancellable.isCancelled(), CoreMatchers.is(true));
-        Assert.assertThat(dependency1.isCancelled(), CoreMatchers.is(true));
+        MatcherAssert.assertThat(cancellable.isCancelled(), CoreMatchers.is(true));
+        MatcherAssert.assertThat(dependency1.isCancelled(), CoreMatchers.is(true));
 
         final BasicFuture<Object> dependency2 = new BasicFuture<>(null);
         cancellable.setDependency(dependency2);
-        Assert.assertThat(dependency2.isCancelled(), CoreMatchers.is(true));
+        MatcherAssert.assertThat(dependency2.isCancelled(), CoreMatchers.is(true));
     }
 
 }
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/concurrent/TestComplexFuture.java b/httpcore5/src/test/java/org/apache/hc/core5/concurrent/TestComplexFuture.java
index ed04a82..e21a97c 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/concurrent/TestComplexFuture.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/concurrent/TestComplexFuture.java
@@ -26,12 +26,13 @@
  */
 package org.apache.hc.core5.concurrent;
 
-import java.util.concurrent.Future;
-
 import org.hamcrest.CoreMatchers;
+import org.hamcrest.MatcherAssert;
 import org.junit.Assert;
 import org.junit.Test;
 
+import java.util.concurrent.Future;
+
 public class TestComplexFuture {
 
     @Test
@@ -44,12 +45,12 @@ public class TestComplexFuture {
         Assert.assertFalse(future.isDone());
 
         future.cancel();
-        Assert.assertThat(future.isCancelled(), CoreMatchers.is(true));
-        Assert.assertThat(dependency1.isCancelled(), CoreMatchers.is(true));
+        MatcherAssert.assertThat(future.isCancelled(), CoreMatchers.is(true));
+        MatcherAssert.assertThat(dependency1.isCancelled(), CoreMatchers.is(true));
 
         final Future<Object> dependency2 = new BasicFuture<>(null);
         future.setDependency(dependency2);
-        Assert.assertThat(dependency2.isCancelled(), CoreMatchers.is(true));
+        MatcherAssert.assertThat(dependency2.isCancelled(), CoreMatchers.is(true));
     }
 
     @Test
@@ -62,12 +63,12 @@ public class TestComplexFuture {
         Assert.assertFalse(future.isDone());
 
         future.completed(Boolean.TRUE);
-        Assert.assertThat(future.isCancelled(), CoreMatchers.is(false));
-        Assert.assertThat(dependency1.isCancelled(), CoreMatchers.is(false));
+        MatcherAssert.assertThat(future.isCancelled(), CoreMatchers.is(false));
+        MatcherAssert.assertThat(dependency1.isCancelled(), CoreMatchers.is(false));
 
         final Future<Object> dependency2 = new BasicFuture<>(null);
         future.setDependency(dependency2);
-        Assert.assertThat(dependency2.isCancelled(), CoreMatchers.is(true));
+        MatcherAssert.assertThat(dependency2.isCancelled(), CoreMatchers.is(true));
     }
 
     @Test
@@ -86,12 +87,12 @@ public class TestComplexFuture {
         Assert.assertFalse(future.isDone());
 
         future.cancel();
-        Assert.assertThat(future.isCancelled(), CoreMatchers.is(true));
-        Assert.assertThat(dependency1.isCancelled(), CoreMatchers.is(true));
+        MatcherAssert.assertThat(future.isCancelled(), CoreMatchers.is(true));
+        MatcherAssert.assertThat(dependency1.isCancelled(), CoreMatchers.is(true));
 
         final Future<Object> dependency2 = new BasicFuture<>(null);
         future.setDependency(dependency2);
-        Assert.assertThat(dependency2.isCancelled(), CoreMatchers.is(true));
+        MatcherAssert.assertThat(dependency2.isCancelled(), CoreMatchers.is(true));
     }
 
 }
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/http/config/TestNamedElementChain.java b/httpcore5/src/test/java/org/apache/hc/core5/http/config/TestNamedElementChain.java
index 203d54d..67c2ad1 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/http/config/TestNamedElementChain.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/http/config/TestNamedElementChain.java
@@ -28,7 +28,7 @@
 package org.apache.hc.core5.http.config;
 
 import org.hamcrest.CoreMatchers;
-import org.junit.Assert;
+import org.hamcrest.MatcherAssert;
 import org.junit.Test;
 
 /**
@@ -39,59 +39,59 @@ public class TestNamedElementChain {
     @Test
     public void testBasics() {
         final NamedElementChain<Character> list = new NamedElementChain<>();
-        Assert.assertThat(list.getFirst(), CoreMatchers.nullValue());
-        Assert.assertThat(list.getLast(), CoreMatchers.nullValue());
+        MatcherAssert.assertThat(list.getFirst(), CoreMatchers.nullValue());
+        MatcherAssert.assertThat(list.getLast(), CoreMatchers.nullValue());
 
         final NamedElementChain<Character>.Node nodeA = list.addFirst('a', "a");
 
-        Assert.assertThat(list.getFirst(), CoreMatchers.sameInstance(nodeA));
-        Assert.assertThat(list.getLast(), CoreMatchers.sameInstance(nodeA));
+        MatcherAssert.assertThat(list.getFirst(), CoreMatchers.sameInstance(nodeA));
+        MatcherAssert.assertThat(list.getLast(), CoreMatchers.sameInstance(nodeA));
 
         final NamedElementChain<Character>.Node nodeB = list.addLast('b', "b");
 
-        Assert.assertThat(list.getFirst(), CoreMatchers.sameInstance(nodeA));
-        Assert.assertThat(list.getLast(), CoreMatchers.sameInstance(nodeB));
+        MatcherAssert.assertThat(list.getFirst(), CoreMatchers.sameInstance(nodeA));
+        MatcherAssert.assertThat(list.getLast(), CoreMatchers.sameInstance(nodeB));
 
         final NamedElementChain<Character>.Node nodeZ = list.addLast('z', "z");
 
-        Assert.assertThat(list.getFirst(), CoreMatchers.sameInstance(nodeA));
-        Assert.assertThat(list.getLast(), CoreMatchers.sameInstance(nodeZ));
+        MatcherAssert.assertThat(list.getFirst(), CoreMatchers.sameInstance(nodeA));
+        MatcherAssert.assertThat(list.getLast(), CoreMatchers.sameInstance(nodeZ));
 
-        Assert.assertThat(nodeA.getPrevious(), CoreMatchers.nullValue());
-        Assert.assertThat(nodeA.getNext(), CoreMatchers.sameInstance(nodeB));
-        Assert.assertThat(nodeB.getPrevious(), CoreMatchers.sameInstance(nodeA));
-        Assert.assertThat(nodeB.getNext(), CoreMatchers.sameInstance(nodeZ));
-        Assert.assertThat(nodeZ.getPrevious(), CoreMatchers.sameInstance(nodeB));
-        Assert.assertThat(nodeZ.getNext(), CoreMatchers.nullValue());
+        MatcherAssert.assertThat(nodeA.getPrevious(), CoreMatchers.nullValue());
+        MatcherAssert.assertThat(nodeA.getNext(), CoreMatchers.sameInstance(nodeB));
+        MatcherAssert.assertThat(nodeB.getPrevious(), CoreMatchers.sameInstance(nodeA));
+        MatcherAssert.assertThat(nodeB.getNext(), CoreMatchers.sameInstance(nodeZ));
+        MatcherAssert.assertThat(nodeZ.getPrevious(), CoreMatchers.sameInstance(nodeB));
+        MatcherAssert.assertThat(nodeZ.getNext(), CoreMatchers.nullValue());
 
         final NamedElementChain<Character>.Node nodeD = list.addAfter("b", 'd', "d");
-        Assert.assertThat(nodeD.getPrevious(), CoreMatchers.sameInstance(nodeB));
-        Assert.assertThat(nodeD.getNext(), CoreMatchers.sameInstance(nodeZ));
-        Assert.assertThat(nodeB.getNext(), CoreMatchers.sameInstance(nodeD));
-        Assert.assertThat(nodeZ.getPrevious(), CoreMatchers.sameInstance(nodeD));
+        MatcherAssert.assertThat(nodeD.getPrevious(), CoreMatchers.sameInstance(nodeB));
+        MatcherAssert.assertThat(nodeD.getNext(), CoreMatchers.sameInstance(nodeZ));
+        MatcherAssert.assertThat(nodeB.getNext(), CoreMatchers.sameInstance(nodeD));
+        MatcherAssert.assertThat(nodeZ.getPrevious(), CoreMatchers.sameInstance(nodeD));
 
         final NamedElementChain<Character>.Node nodeC = list.addBefore("d", 'c', "c");
-        Assert.assertThat(nodeC.getPrevious(), CoreMatchers.sameInstance(nodeB));
-        Assert.assertThat(nodeC.getNext(), CoreMatchers.sameInstance(nodeD));
-        Assert.assertThat(nodeB.getNext(), CoreMatchers.sameInstance(nodeC));
-        Assert.assertThat(nodeD.getPrevious(), CoreMatchers.sameInstance(nodeC));
-        Assert.assertThat(list.getSize(), CoreMatchers.equalTo(5));
-
-        Assert.assertThat(list.remove("a"), CoreMatchers.is(true));
-        Assert.assertThat(list.remove("z"), CoreMatchers.is(true));
-        Assert.assertThat(list.remove("c"), CoreMatchers.is(true));
-        Assert.assertThat(list.remove("c"), CoreMatchers.is(false));
-        Assert.assertThat(list.remove("blah"), CoreMatchers.is(false));
-
-        Assert.assertThat(list.getFirst(), CoreMatchers.sameInstance(nodeB));
-        Assert.assertThat(list.getLast(), CoreMatchers.sameInstance(nodeD));
-
-        Assert.assertThat(list.getSize(), CoreMatchers.equalTo(2));
-        Assert.assertThat(list.addBefore("blah", 'e', "e"), CoreMatchers.nullValue());
-        Assert.assertThat(list.getSize(), CoreMatchers.equalTo(2));
-
-        Assert.assertThat(list.addAfter("yada", 'e', "e"), CoreMatchers.nullValue());
-        Assert.assertThat(list.getSize(), CoreMatchers.equalTo(2));
+        MatcherAssert.assertThat(nodeC.getPrevious(), CoreMatchers.sameInstance(nodeB));
+        MatcherAssert.assertThat(nodeC.getNext(), CoreMatchers.sameInstance(nodeD));
+        MatcherAssert.assertThat(nodeB.getNext(), CoreMatchers.sameInstance(nodeC));
+        MatcherAssert.assertThat(nodeD.getPrevious(), CoreMatchers.sameInstance(nodeC));
+        MatcherAssert.assertThat(list.getSize(), CoreMatchers.equalTo(5));
+
+        MatcherAssert.assertThat(list.remove("a"), CoreMatchers.is(true));
+        MatcherAssert.assertThat(list.remove("z"), CoreMatchers.is(true));
+        MatcherAssert.assertThat(list.remove("c"), CoreMatchers.is(true));
+        MatcherAssert.assertThat(list.remove("c"), CoreMatchers.is(false));
+        MatcherAssert.assertThat(list.remove("blah"), CoreMatchers.is(false));
+
+        MatcherAssert.assertThat(list.getFirst(), CoreMatchers.sameInstance(nodeB));
+        MatcherAssert.assertThat(list.getLast(), CoreMatchers.sameInstance(nodeD));
+
+        MatcherAssert.assertThat(list.getSize(), CoreMatchers.equalTo(2));
+        MatcherAssert.assertThat(list.addBefore("blah", 'e', "e"), CoreMatchers.nullValue());
+        MatcherAssert.assertThat(list.getSize(), CoreMatchers.equalTo(2));
+
+        MatcherAssert.assertThat(list.addAfter("yada", 'e', "e"), CoreMatchers.nullValue());
+        MatcherAssert.assertThat(list.getSize(), CoreMatchers.equalTo(2));
     }
 
 }
\ No newline at end of file
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestExpandableBuffer.java b/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestExpandableBuffer.java
index 4f0dfe7..d98d3fc 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestExpandableBuffer.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/http/impl/nio/TestExpandableBuffer.java
@@ -28,7 +28,7 @@
 package org.apache.hc.core5.http.impl.nio;
 
 import org.hamcrest.CoreMatchers;
-import org.junit.Assert;
+import org.hamcrest.MatcherAssert;
 import org.junit.Test;
 
 public class TestExpandableBuffer {
@@ -36,47 +36,47 @@ public class TestExpandableBuffer {
     @Test
     public void testBasics() throws Exception {
         final ExpandableBuffer buffer = new ExpandableBuffer(16);
-        Assert.assertThat(buffer.mode(), CoreMatchers.equalTo(ExpandableBuffer.Mode.INPUT));
-        Assert.assertThat(buffer.hasData(), CoreMatchers.equalTo(false));
+        MatcherAssert.assertThat(buffer.mode(), CoreMatchers.equalTo(ExpandableBuffer.Mode.INPUT));
+        MatcherAssert.assertThat(buffer.hasData(), CoreMatchers.equalTo(false));
 
         buffer.setInputMode();
         buffer.buffer().put(new byte[] { 0, 1, 2, 3, 4, 5});
-        Assert.assertThat(buffer.hasData(), CoreMatchers.equalTo(true));
-        Assert.assertThat(buffer.length(), CoreMatchers.equalTo(6));
-        Assert.assertThat(buffer.buffer().capacity(), CoreMatchers.equalTo(16));
-        Assert.assertThat(buffer.mode(), CoreMatchers.equalTo(ExpandableBuffer.Mode.OUTPUT));
+        MatcherAssert.assertThat(buffer.hasData(), CoreMatchers.equalTo(true));
+        MatcherAssert.assertThat(buffer.length(), CoreMatchers.equalTo(6));
+        MatcherAssert.assertThat(buffer.buffer().capacity(), CoreMatchers.equalTo(16));
+        MatcherAssert.assertThat(buffer.mode(), CoreMatchers.equalTo(ExpandableBuffer.Mode.OUTPUT));
 
         buffer.setInputMode();
         buffer.buffer().put(new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 });
-        Assert.assertThat(buffer.length(), CoreMatchers.equalTo(16));
-        Assert.assertThat(buffer.buffer().capacity(), CoreMatchers.equalTo(16));
-        Assert.assertThat(buffer.mode(), CoreMatchers.equalTo(ExpandableBuffer.Mode.OUTPUT));
+        MatcherAssert.assertThat(buffer.length(), CoreMatchers.equalTo(16));
+        MatcherAssert.assertThat(buffer.buffer().capacity(), CoreMatchers.equalTo(16));
+        MatcherAssert.assertThat(buffer.mode(), CoreMatchers.equalTo(ExpandableBuffer.Mode.OUTPUT));
 
         buffer.setInputMode();
         buffer.ensureCapacity(22);
         buffer.buffer().put(new byte[] { 0, 1, 2, 3, 4, 5});
-        Assert.assertThat(buffer.length(), CoreMatchers.equalTo(22));
-        Assert.assertThat(buffer.buffer().capacity(), CoreMatchers.equalTo(22));
-        Assert.assertThat(buffer.mode(), CoreMatchers.equalTo(ExpandableBuffer.Mode.OUTPUT));
+        MatcherAssert.assertThat(buffer.length(), CoreMatchers.equalTo(22));
+        MatcherAssert.assertThat(buffer.buffer().capacity(), CoreMatchers.equalTo(22));
+        MatcherAssert.assertThat(buffer.mode(), CoreMatchers.equalTo(ExpandableBuffer.Mode.OUTPUT));
 
         buffer.clear();
-        Assert.assertThat(buffer.mode(), CoreMatchers.equalTo(ExpandableBuffer.Mode.INPUT));
-        Assert.assertThat(buffer.hasData(), CoreMatchers.equalTo(false));
-        Assert.assertThat(buffer.capacity(), CoreMatchers.equalTo(22));
+        MatcherAssert.assertThat(buffer.mode(), CoreMatchers.equalTo(ExpandableBuffer.Mode.INPUT));
+        MatcherAssert.assertThat(buffer.hasData(), CoreMatchers.equalTo(false));
+        MatcherAssert.assertThat(buffer.capacity(), CoreMatchers.equalTo(22));
     }
 
     @Test
     public void testAdjustCapacity() throws Exception {
         final ExpandableBuffer buffer = new ExpandableBuffer(16);
-        Assert.assertThat(buffer.capacity(), CoreMatchers.equalTo(16));
+        MatcherAssert.assertThat(buffer.capacity(), CoreMatchers.equalTo(16));
 
         buffer.ensureCapacity(21);
-        Assert.assertThat(buffer.capacity(), CoreMatchers.equalTo(21));
+        MatcherAssert.assertThat(buffer.capacity(), CoreMatchers.equalTo(21));
         buffer.ensureAdjustedCapacity(22);
-        Assert.assertThat(buffer.capacity(), CoreMatchers.equalTo(1024));
+        MatcherAssert.assertThat(buffer.capacity(), CoreMatchers.equalTo(1024));
         buffer.ensureAdjustedCapacity(1024);
-        Assert.assertThat(buffer.capacity(), CoreMatchers.equalTo(1024));
+        MatcherAssert.assertThat(buffer.capacity(), CoreMatchers.equalTo(1024));
         buffer.ensureAdjustedCapacity(1025);
-        Assert.assertThat(buffer.capacity(), CoreMatchers.equalTo(2048));
+        MatcherAssert.assertThat(buffer.capacity(), CoreMatchers.equalTo(2048));
     }
 }
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/http/ssl/TestTlsVersionParser.java b/httpcore5/src/test/java/org/apache/hc/core5/http/ssl/TestTlsVersionParser.java
index 221f49d..7966ae2 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/http/ssl/TestTlsVersionParser.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/http/ssl/TestTlsVersionParser.java
@@ -31,7 +31,7 @@ import org.apache.hc.core5.http.ParseException;
 import org.apache.hc.core5.http.ProtocolVersion;
 import org.apache.hc.core5.util.Tokenizer;
 import org.hamcrest.CoreMatchers;
-import org.junit.Assert;
+import org.hamcrest.MatcherAssert;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -49,19 +49,19 @@ public class TestTlsVersionParser {
 
     @Test
     public void testParseBasic() throws Exception {
-        Assert.assertThat(impl.parse("TLSv1"), CoreMatchers.equalTo(TLS.V_1_0.version));
-        Assert.assertThat(impl.parse("TLSv1.1"), CoreMatchers.equalTo(TLS.V_1_1.version));
-        Assert.assertThat(impl.parse("TLSv1.2"), CoreMatchers.equalTo(TLS.V_1_2.version));
-        Assert.assertThat(impl.parse("TLSv1.3"), CoreMatchers.equalTo(TLS.V_1_3.version));
-        Assert.assertThat(impl.parse("TLSv22.356"), CoreMatchers.equalTo(new ProtocolVersion("TLS", 22, 356)));
+        MatcherAssert.assertThat(impl.parse("TLSv1"), CoreMatchers.equalTo(TLS.V_1_0.version));
+        MatcherAssert.assertThat(impl.parse("TLSv1.1"), CoreMatchers.equalTo(TLS.V_1_1.version));
+        MatcherAssert.assertThat(impl.parse("TLSv1.2"), CoreMatchers.equalTo(TLS.V_1_2.version));
+        MatcherAssert.assertThat(impl.parse("TLSv1.3"), CoreMatchers.equalTo(TLS.V_1_3.version));
+        MatcherAssert.assertThat(impl.parse("TLSv22.356"), CoreMatchers.equalTo(new ProtocolVersion("TLS", 22, 356)));
     }
 
     @Test
     public void testParseBuffer() throws Exception {
         final Tokenizer.Cursor cursor = new Tokenizer.Cursor(1, 13);
-        Assert.assertThat(impl.parse(" TLSv1.2,0000", cursor, Tokenizer.INIT_BITSET(',')),
+        MatcherAssert.assertThat(impl.parse(" TLSv1.2,0000", cursor, Tokenizer.INIT_BITSET(',')),
                 CoreMatchers.equalTo(TLS.V_1_2.version));
-        Assert.assertThat(cursor.getPos(), CoreMatchers.equalTo(8));
+        MatcherAssert.assertThat(cursor.getPos(), CoreMatchers.equalTo(8));
     }
 
     @Test(expected = ParseException.class)
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/reactor/TestAbstractIOSessionPool.java b/httpcore5/src/test/java/org/apache/hc/core5/reactor/TestAbstractIOSessionPool.java
index fe87e61..cca22d1 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/reactor/TestAbstractIOSessionPool.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/reactor/TestAbstractIOSessionPool.java
@@ -26,15 +26,13 @@
  */
 package org.apache.hc.core5.reactor;
 
-import java.util.concurrent.Future;
-
 import org.apache.hc.core5.concurrent.FutureCallback;
 import org.apache.hc.core5.function.Callback;
 import org.apache.hc.core5.io.CloseMode;
 import org.apache.hc.core5.util.TimeValue;
 import org.apache.hc.core5.util.Timeout;
 import org.hamcrest.CoreMatchers;
-import org.junit.Assert;
+import org.hamcrest.MatcherAssert;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -47,6 +45,8 @@ import org.mockito.invocation.InvocationOnMock;
 import org.mockito.junit.MockitoJUnitRunner;
 import org.mockito.stubbing.Answer;
 
+import java.util.concurrent.Future;
+
 @RunWith(MockitoJUnitRunner.class)
 public class TestAbstractIOSessionPool {
 
@@ -92,9 +92,9 @@ public class TestAbstractIOSessionPool {
         Mockito.when(ioSession1.isOpen()).thenReturn(true);
 
         final Future<IOSession> future1 = impl.getSession("somehost", Timeout.ofSeconds(123L), null);
-        Assert.assertThat(future1, CoreMatchers.notNullValue());
-        Assert.assertThat(future1.isDone(), CoreMatchers.equalTo(false));
-        Assert.assertThat(impl.getRoutes(), CoreMatchers.hasItem("somehost"));
+        MatcherAssert.assertThat(future1, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(future1.isDone(), CoreMatchers.equalTo(false));
+        MatcherAssert.assertThat(impl.getRoutes(), CoreMatchers.hasItem("somehost"));
 
         Mockito.verify(impl).connectSession(
                 ArgumentMatchers.eq("somehost"),
@@ -102,9 +102,9 @@ public class TestAbstractIOSessionPool {
                 ArgumentMatchers.<FutureCallback<IOSession>>any());
 
         final Future<IOSession> future2 = impl.getSession("somehost", Timeout.ofSeconds(123L), null);
-        Assert.assertThat(future2, CoreMatchers.notNullValue());
-        Assert.assertThat(future2.isDone(), CoreMatchers.equalTo(false));
-        Assert.assertThat(impl.getRoutes(), CoreMatchers.hasItem("somehost"));
+        MatcherAssert.assertThat(future2, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(future2.isDone(), CoreMatchers.equalTo(false));
+        MatcherAssert.assertThat(impl.getRoutes(), CoreMatchers.hasItem("somehost"));
 
         Mockito.verify(impl, Mockito.times(1)).connectSession(
                 ArgumentMatchers.eq("somehost"),
@@ -119,11 +119,11 @@ public class TestAbstractIOSessionPool {
 
                 }));
 
-        Assert.assertThat(future1.isDone(), CoreMatchers.equalTo(true));
-        Assert.assertThat(future1.get(), CoreMatchers.sameInstance(ioSession1));
+        MatcherAssert.assertThat(future1.isDone(), CoreMatchers.equalTo(true));
+        MatcherAssert.assertThat(future1.get(), CoreMatchers.sameInstance(ioSession1));
 
-        Assert.assertThat(future2.isDone(), CoreMatchers.equalTo(true));
-        Assert.assertThat(future2.get(), CoreMatchers.sameInstance(ioSession1));
+        MatcherAssert.assertThat(future2.isDone(), CoreMatchers.equalTo(true));
+        MatcherAssert.assertThat(future2.get(), CoreMatchers.sameInstance(ioSession1));
 
         Mockito.verify(impl, Mockito.times(2)).validateSession(ArgumentMatchers.<IOSession>any(), ArgumentMatchers.<Callback<Boolean>>any());
 
@@ -136,8 +136,8 @@ public class TestAbstractIOSessionPool {
 
         Mockito.verify(impl, Mockito.times(3)).validateSession(ArgumentMatchers.<IOSession>any(), ArgumentMatchers.<Callback<Boolean>>any());
 
-        Assert.assertThat(future3.isDone(), CoreMatchers.equalTo(true));
-        Assert.assertThat(future3.get(), CoreMatchers.sameInstance(ioSession1));
+        MatcherAssert.assertThat(future3.isDone(), CoreMatchers.equalTo(true));
+        MatcherAssert.assertThat(future3.get(), CoreMatchers.sameInstance(ioSession1));
     }
 
     @Test
@@ -149,9 +149,9 @@ public class TestAbstractIOSessionPool {
                 ArgumentMatchers.<FutureCallback<IOSession>>any())).thenReturn(connectFuture);
 
         final Future<IOSession> future1 = impl.getSession("somehost", Timeout.ofSeconds(123L), null);
-        Assert.assertThat(future1, CoreMatchers.notNullValue());
-        Assert.assertThat(future1.isDone(), CoreMatchers.equalTo(false));
-        Assert.assertThat(impl.getRoutes(), CoreMatchers.hasItem("somehost"));
+        MatcherAssert.assertThat(future1, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(future1.isDone(), CoreMatchers.equalTo(false));
+        MatcherAssert.assertThat(impl.getRoutes(), CoreMatchers.hasItem("somehost"));
 
         Mockito.verify(impl).connectSession(
                 ArgumentMatchers.eq("somehost"),
@@ -159,9 +159,9 @@ public class TestAbstractIOSessionPool {
                 ArgumentMatchers.<FutureCallback<IOSession>>any());
 
         final Future<IOSession> future2 = impl.getSession("somehost", Timeout.ofSeconds(123L), null);
-        Assert.assertThat(future2, CoreMatchers.notNullValue());
-        Assert.assertThat(future2.isDone(), CoreMatchers.equalTo(false));
-        Assert.assertThat(impl.getRoutes(), CoreMatchers.hasItem("somehost"));
+        MatcherAssert.assertThat(future2, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(future2.isDone(), CoreMatchers.equalTo(false));
+        MatcherAssert.assertThat(impl.getRoutes(), CoreMatchers.hasItem("somehost"));
 
         Mockito.verify(impl, Mockito.times(1)).connectSession(
                 ArgumentMatchers.eq("somehost"),
@@ -176,22 +176,22 @@ public class TestAbstractIOSessionPool {
 
                 }));
 
-        Assert.assertThat(future1.isDone(), CoreMatchers.equalTo(true));
-        Assert.assertThat(future2.isDone(), CoreMatchers.equalTo(true));
+        MatcherAssert.assertThat(future1.isDone(), CoreMatchers.equalTo(true));
+        MatcherAssert.assertThat(future2.isDone(), CoreMatchers.equalTo(true));
     }
 
     @Test
     public void testShutdownPool() throws Exception {
         final AbstractIOSessionPool.PoolEntry entry1 = impl.getPoolEntry("host1");
-        Assert.assertThat(entry1, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(entry1, CoreMatchers.notNullValue());
         entry1.session = ioSession1;
 
         final AbstractIOSessionPool.PoolEntry entry2 = impl.getPoolEntry("host2");
-        Assert.assertThat(entry2, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(entry2, CoreMatchers.notNullValue());
         entry2.session = ioSession2;
 
         final AbstractIOSessionPool.PoolEntry entry3 = impl.getPoolEntry("host3");
-        Assert.assertThat(entry3, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(entry3, CoreMatchers.notNullValue());
         entry3.sessionFuture = connectFuture;
         entry3.requestQueue.add(callback1);
         entry3.requestQueue.add(callback2);
@@ -208,11 +208,11 @@ public class TestAbstractIOSessionPool {
     @Test
     public void testCloseIdleSessions() throws Exception {
         final AbstractIOSessionPool.PoolEntry entry1 = impl.getPoolEntry("host1");
-        Assert.assertThat(entry1, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(entry1, CoreMatchers.notNullValue());
         entry1.session = ioSession1;
 
         final AbstractIOSessionPool.PoolEntry entry2 = impl.getPoolEntry("host2");
-        Assert.assertThat(entry2, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(entry2, CoreMatchers.notNullValue());
         entry2.session = ioSession2;
 
         impl.closeIdle(TimeValue.ZERO_MILLISECONDS);
@@ -220,18 +220,18 @@ public class TestAbstractIOSessionPool {
         Mockito.verify(impl).closeSession(ioSession1, CloseMode.GRACEFUL);
         Mockito.verify(impl).closeSession(ioSession2, CloseMode.GRACEFUL);
 
-        Assert.assertThat(entry1.session, CoreMatchers.nullValue());
-        Assert.assertThat(entry2.session, CoreMatchers.nullValue());
+        MatcherAssert.assertThat(entry1.session, CoreMatchers.nullValue());
+        MatcherAssert.assertThat(entry2.session, CoreMatchers.nullValue());
     }
 
     @Test
     public void testEnumSessions() throws Exception {
         final AbstractIOSessionPool.PoolEntry entry1 = impl.getPoolEntry("host1");
-        Assert.assertThat(entry1, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(entry1, CoreMatchers.notNullValue());
         entry1.session = ioSession1;
 
         final AbstractIOSessionPool.PoolEntry entry2 = impl.getPoolEntry("host2");
-        Assert.assertThat(entry2, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(entry2, CoreMatchers.notNullValue());
         entry2.session = ioSession2;
 
         impl.enumAvailable(new Callback<IOSession>() {
@@ -249,7 +249,7 @@ public class TestAbstractIOSessionPool {
     @Test
     public void testGetSessionReconnectAfterValidate() throws Exception {
         final AbstractIOSessionPool.PoolEntry entry1 = impl.getPoolEntry("somehost");
-        Assert.assertThat(entry1, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(entry1, CoreMatchers.notNullValue());
         entry1.session = ioSession1;
 
         Mockito.when(ioSession1.isOpen()).thenReturn(true);
@@ -275,7 +275,7 @@ public class TestAbstractIOSessionPool {
     @Test
     public void testGetSessionReconnectIfClosed() throws Exception {
         final AbstractIOSessionPool.PoolEntry entry1 = impl.getPoolEntry("somehost");
-        Assert.assertThat(entry1, CoreMatchers.notNullValue());
+        MatcherAssert.assertThat(entry1, CoreMatchers.notNullValue());
         entry1.session = ioSession1;
 
         Mockito.when(ioSession1.isOpen()).thenReturn(false);
diff --git a/httpcore5/src/test/java/org/apache/hc/core5/util/TestTimeValue.java b/httpcore5/src/test/java/org/apache/hc/core5/util/TestTimeValue.java
index 18bc451..2e852ce 100644
--- a/httpcore5/src/test/java/org/apache/hc/core5/util/TestTimeValue.java
+++ b/httpcore5/src/test/java/org/apache/hc/core5/util/TestTimeValue.java
@@ -27,13 +27,14 @@
 
 package org.apache.hc.core5.util;
 
-import java.text.ParseException;
-import java.util.concurrent.TimeUnit;
-
 import org.hamcrest.CoreMatchers;
+import org.hamcrest.MatcherAssert;
 import org.junit.Assert;
 import org.junit.Test;
 
+import java.text.ParseException;
+import java.util.concurrent.TimeUnit;
+
 public class TestTimeValue {
 
     private void checkToDays(final long value, final TimeUnit timeUnit) {
@@ -271,19 +272,19 @@ public class TestTimeValue {
         final TimeValue tv4 = TimeValue.ofSeconds(1L);
         final TimeValue tv5 = TimeValue.ofSeconds(1000L);
 
-        Assert.assertThat(tv1.equals(tv1), CoreMatchers.equalTo(true));
-        Assert.assertThat(tv1.equals(null), CoreMatchers.equalTo(false));
-        Assert.assertThat(tv1.equals(tv2), CoreMatchers.equalTo(false));
-        Assert.assertThat(tv1.equals(tv3), CoreMatchers.equalTo(true));
-        Assert.assertThat(tv1.equals(tv4), CoreMatchers.equalTo(true));
-        Assert.assertThat(tv4.equals(tv1), CoreMatchers.equalTo(true));
-        Assert.assertThat(tv1.equals(tv5), CoreMatchers.equalTo(false));
-
-        Assert.assertThat(tv1.hashCode() == tv2.hashCode(), CoreMatchers.equalTo(false));
-        Assert.assertThat(tv1.hashCode() == tv3.hashCode(), CoreMatchers.equalTo(true));
-        Assert.assertThat(tv1.hashCode() == tv4.hashCode(), CoreMatchers.equalTo(true));
-        Assert.assertThat(tv4.hashCode() == tv1.hashCode(), CoreMatchers.equalTo(true));
-        Assert.assertThat(tv1.hashCode() == tv5.hashCode(), CoreMatchers.equalTo(false));
+        MatcherAssert.assertThat(tv1.equals(tv1), CoreMatchers.equalTo(true));
+        MatcherAssert.assertThat(tv1.equals(null), CoreMatchers.equalTo(false));
+        MatcherAssert.assertThat(tv1.equals(tv2), CoreMatchers.equalTo(false));
+        MatcherAssert.assertThat(tv1.equals(tv3), CoreMatchers.equalTo(true));
+        MatcherAssert.assertThat(tv1.equals(tv4), CoreMatchers.equalTo(true));
+        MatcherAssert.assertThat(tv4.equals(tv1), CoreMatchers.equalTo(true));
+        MatcherAssert.assertThat(tv1.equals(tv5), CoreMatchers.equalTo(false));
+
+        MatcherAssert.assertThat(tv1.hashCode() == tv2.hashCode(), CoreMatchers.equalTo(false));
+        MatcherAssert.assertThat(tv1.hashCode() == tv3.hashCode(), CoreMatchers.equalTo(true));
+        MatcherAssert.assertThat(tv1.hashCode() == tv4.hashCode(), CoreMatchers.equalTo(true));
+        MatcherAssert.assertThat(tv4.hashCode() == tv1.hashCode(), CoreMatchers.equalTo(true));
+        MatcherAssert.assertThat(tv1.hashCode() == tv5.hashCode(), CoreMatchers.equalTo(false));
     }
 
     @Test
@@ -295,13 +296,13 @@ public class TestTimeValue {
         final TimeValue tv5 = TimeValue.ofSeconds(60L);
         final TimeValue tv6 = TimeValue.ofMinutes(1L);
 
-        Assert.assertThat(tv1.compareTo(tv1) == 0, CoreMatchers.equalTo(true));
-        Assert.assertThat(tv1.compareTo(tv2) < 0, CoreMatchers.equalTo(true));
-        Assert.assertThat(tv1.compareTo(tv3) == 0, CoreMatchers.equalTo(true));
-        Assert.assertThat(tv1.compareTo(tv4) == 0, CoreMatchers.equalTo(true));
-        Assert.assertThat(tv1.compareTo(tv5) < 0, CoreMatchers.equalTo(true));
-        Assert.assertThat(tv6.compareTo(tv5) == 0, CoreMatchers.equalTo(true));
-        Assert.assertThat(tv6.compareTo(tv4) > 0, CoreMatchers.equalTo(true));
+        MatcherAssert.assertThat(tv1.compareTo(tv1) == 0, CoreMatchers.equalTo(true));
+        MatcherAssert.assertThat(tv1.compareTo(tv2) < 0, CoreMatchers.equalTo(true));
+        MatcherAssert.assertThat(tv1.compareTo(tv3) == 0, CoreMatchers.equalTo(true));
+        MatcherAssert.assertThat(tv1.compareTo(tv4) == 0, CoreMatchers.equalTo(true));
+        MatcherAssert.assertThat(tv1.compareTo(tv5) < 0, CoreMatchers.equalTo(true));
+        MatcherAssert.assertThat(tv6.compareTo(tv5) == 0, CoreMatchers.equalTo(true));
+        MatcherAssert.assertThat(tv6.compareTo(tv4) > 0, CoreMatchers.equalTo(true));
         try {
             tv1.compareTo(null);
             Assert.fail("NullPointerException expected");