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/05/24 12:43:40 UTC

[httpcomponents-client] branch master updated (2abb01d -> 8580d7f)

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

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


 discard 2abb01d  Redundant type declarations
 discard 62bab1a  Upgraded Mockito to version 3.10.0
     new 2072651  Upgraded Mockito to version 3.10.0
     new 8580d7f  Redundant type declarations

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (2abb01d)
            \
             N -- N -- N   refs/heads/master (8580d7f)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:

[httpcomponents-client] 01/02: Upgraded Mockito to version 3.10.0

Posted by ol...@apache.org.
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-client.git

commit 207265198395e4267200a200ab8acfc37aa78498
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Mon May 24 14:43:08 2021 +0200

    Upgraded Mockito to version 3.10.0
---
 .../hc/client5/http/impl/classic/TestConnectExec.java      | 13 +++----------
 .../http/impl/classic/TestHttpRequestRetryExec.java        | 14 +++-----------
 .../client5/http/impl/classic/TestInternalExecRuntime.java |  5 +++--
 .../client5/http/impl/classic/TestInternalHttpClient.java  |  5 +++--
 .../hc/client5/http/impl/classic/TestMainClientExec.java   | 14 +++-----------
 .../hc/client5/http/impl/classic/TestProtocolExec.java     | 10 +++-------
 .../client5/http/impl/classic/TestResponseEntityProxy.java | 13 +++++++------
 .../http/impl/io/TestBasicHttpClientConnectionManager.java |  5 +++--
 .../impl/io/TestPoolingHttpClientConnectionManager.java    | 13 +++----------
 pom.xml                                                    |  2 +-
 10 files changed, 32 insertions(+), 62 deletions(-)

diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestConnectExec.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestConnectExec.java
index 29ad749..a2bdc7c 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestConnectExec.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestConnectExec.java
@@ -63,13 +63,15 @@ import org.apache.hc.core5.http.protocol.HttpProcessor;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
+import org.mockito.junit.MockitoJUnitRunner;
 import org.mockito.stubbing.Answer;
 
 @SuppressWarnings({"boxing","static-access"}) // test code
+@RunWith(MockitoJUnitRunner.class)
 public class TestConnectExec {
 
     @Mock
@@ -89,7 +91,6 @@ public class TestConnectExec {
 
     @Before
     public void setup() throws Exception {
-        MockitoAnnotations.initMocks(this);
         exec = new ConnectExec(reuseStrategy, proxyHttpProcessor, proxyAuthStrategy);
         target = new HttpHost("foo", 80);
         proxy = new HttpHost("bar", 8888);
@@ -107,14 +108,6 @@ public class TestConnectExec {
         context.setUserToken("Blah");
 
         Mockito.when(execRuntime.isEndpointAcquired()).thenReturn(false);
-        Mockito.when(execRuntime.execute(
-                Mockito.eq("test"),
-                Mockito.same(request),
-                Mockito.<HttpClientContext>any())).thenReturn(response);
-        Mockito.when(reuseStrategy.keepAlive(
-                Mockito.same(request),
-                Mockito.same(response),
-                Mockito.<HttpClientContext>any())).thenReturn(false);
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, execRuntime, context);
         exec.execute(request, scope, execChain);
         Mockito.verify(execRuntime).acquireEndpoint("test", route, "Blah", context);
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestHttpRequestRetryExec.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestHttpRequestRetryExec.java
index 223de81..32c6542 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestHttpRequestRetryExec.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestHttpRequestRetryExec.java
@@ -52,11 +52,13 @@ import org.apache.hc.core5.util.Timeout;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
+import org.mockito.junit.MockitoJUnitRunner;
 
 @SuppressWarnings({"boxing","static-access"}) // test code
+@RunWith(MockitoJUnitRunner.class)
 public class TestHttpRequestRetryExec {
 
     @Mock
@@ -71,7 +73,6 @@ public class TestHttpRequestRetryExec {
 
     @Before
     public void setup() throws Exception {
-        MockitoAnnotations.initMocks(this);
         retryExec = new HttpRequestRetryExec(retryStrategy);
         target = new HttpHost("localhost", 80);
     }
@@ -207,10 +208,6 @@ public class TestHttpRequestRetryExec {
         Mockito.when(chain.proceed(
                 Mockito.<ClassicHttpRequest>any(),
                 Mockito.<ExecChain.Scope>any())).thenReturn(response);
-        Mockito.when(retryStrategy.retryRequest(
-                Mockito.<HttpResponse>any(),
-                Mockito.anyInt(),
-                Mockito.<HttpContext>any())).thenReturn(Boolean.TRUE, Boolean.FALSE);
 
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, endpoint, context);
         final ClassicHttpResponse finalResponse = retryExec.execute(request, scope, chain);
@@ -303,11 +300,6 @@ public class TestHttpRequestRetryExec {
                     req.getEntity().writeTo(new ByteArrayOutputStream());
                     throw new IOException("Ka-boom");
                 });
-        Mockito.when(retryStrategy.retryRequest(
-                Mockito.<HttpRequest>any(),
-                Mockito.<IOException>any(),
-                Mockito.eq(1),
-                Mockito.<HttpContext>any())).thenReturn(Boolean.TRUE);
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, originalRequest, endpoint, context);
         final ClassicHttpRequest request = ClassicRequestBuilder.copy(originalRequest).build();
         try {
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestInternalExecRuntime.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestInternalExecRuntime.java
index 9387cb4..a7ec7f6 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestInternalExecRuntime.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestInternalExecRuntime.java
@@ -47,12 +47,14 @@ import org.apache.hc.core5.util.Timeout;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
+import org.mockito.junit.MockitoJUnitRunner;
 import org.slf4j.Logger;
 
 @SuppressWarnings({"static-access"}) // test code
+@RunWith(MockitoJUnitRunner.class)
 public class TestInternalExecRuntime {
 
     @Mock
@@ -73,7 +75,6 @@ public class TestInternalExecRuntime {
 
     @Before
     public void setup() {
-        MockitoAnnotations.initMocks(this);
         route = new HttpRoute(new HttpHost("host", 80));
         execRuntime = new InternalExecRuntime(log, mgr, requestExecutor, cancellableDependency);
     }
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestInternalHttpClient.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestInternalHttpClient.java
index bc905ee..b67fea1 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestInternalHttpClient.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestInternalHttpClient.java
@@ -51,14 +51,16 @@ import org.apache.hc.core5.http.impl.io.HttpRequestExecutor;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
+import org.mockito.junit.MockitoJUnitRunner;
 
 /**
  *  Simple tests for {@link InternalHttpClient}.
  */
 @SuppressWarnings({"static-access"}) // test code
+@RunWith(MockitoJUnitRunner.class)
 public class TestInternalHttpClient {
 
     @Mock
@@ -88,7 +90,6 @@ public class TestInternalHttpClient {
 
     @Before
     public void setup() throws Exception {
-        MockitoAnnotations.initMocks(this);
         client = new InternalHttpClient(connManager, requestExecutor, new ExecChainElement(execChain, null), routePlanner,
                 cookieSpecRegistry, authSchemeRegistry, cookieStore, credentialsProvider,
                 defaultConfig, Arrays.asList(closeable1, closeable2));
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestMainClientExec.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestMainClientExec.java
index 35e4ce4..1f763f1 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestMainClientExec.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestMainClientExec.java
@@ -50,12 +50,14 @@ import org.apache.hc.core5.util.TimeValue;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
+import org.mockito.junit.MockitoJUnitRunner;
 import org.mockito.stubbing.Answer;
 
 @SuppressWarnings({"boxing","static-access"}) // test code
+@RunWith(MockitoJUnitRunner.class)
 public class TestMainClientExec {
 
     @Mock
@@ -74,7 +76,6 @@ public class TestMainClientExec {
 
     @Before
     public void setup() throws Exception {
-        MockitoAnnotations.initMocks(this);
         mainClientExec = new MainClientExec(connectionManager, reuseStrategy, keepAliveStrategy, userTokenHandler);
         target = new HttpHost("foo", 80);
     }
@@ -89,7 +90,6 @@ public class TestMainClientExec {
                 .setStream(new ByteArrayInputStream(new byte[]{}))
                 .build());
 
-        Mockito.when(endpoint.isEndpointAcquired()).thenReturn(false);
         Mockito.when(endpoint.execute(
                 Mockito.anyString(),
                 Mockito.same(request),
@@ -118,7 +118,6 @@ public class TestMainClientExec {
         final ClassicHttpResponse response = new BasicClassicHttpResponse(200, "OK");
         response.setEntity(null);
 
-        Mockito.when(endpoint.isEndpointAcquired()).thenReturn(false);
         Mockito.when(endpoint.execute(
                 Mockito.anyString(),
                 Mockito.same(request),
@@ -151,8 +150,6 @@ public class TestMainClientExec {
                 .build());
 
         final ConnectionState connectionState = new ConnectionState();
-        Mockito.doAnswer(connectionState.connectAnswer()).when(endpoint).connectEndpoint(Mockito.<HttpClientContext>any());
-        Mockito.when(endpoint.isEndpointConnected()).thenAnswer(connectionState.isConnectedAnswer());
         Mockito.when(endpoint.execute(
                 Mockito.anyString(),
                 Mockito.same(request),
@@ -183,9 +180,6 @@ public class TestMainClientExec {
         final ClassicHttpRequest request = new HttpGet("http://bar/test");
         final ClassicHttpResponse response = new BasicClassicHttpResponse(200, "OK");
 
-        final ConnectionState connectionState = new ConnectionState();
-        Mockito.doAnswer(connectionState.connectAnswer()).when(endpoint).connectEndpoint(Mockito.<HttpClientContext>any());
-        Mockito.when(endpoint.isEndpointConnected()).thenAnswer(connectionState.isConnectedAnswer());
         Mockito.when(endpoint.execute(
                 Mockito.anyString(),
                 Mockito.same(request),
@@ -220,8 +214,6 @@ public class TestMainClientExec {
                 .build());
 
         final ConnectionState connectionState = new ConnectionState();
-        Mockito.doAnswer(connectionState.connectAnswer()).when(endpoint).connectEndpoint(Mockito.<HttpClientContext>any());
-        Mockito.when(endpoint.isEndpointConnected()).thenAnswer(connectionState.isConnectedAnswer());
         Mockito.when(endpoint.execute(
                 Mockito.anyString(),
                 Mockito.same(request),
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestProtocolExec.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestProtocolExec.java
index c560bbc..b4b34e9 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestProtocolExec.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestProtocolExec.java
@@ -67,12 +67,14 @@ import org.apache.hc.core5.http.protocol.HttpProcessor;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
+import org.mockito.junit.MockitoJUnitRunner;
 import org.mockito.stubbing.Answer;
 
 @SuppressWarnings({"static-access"}) // test code
+@RunWith(MockitoJUnitRunner.class)
 public class TestProtocolExec {
 
     @Mock
@@ -92,7 +94,6 @@ public class TestProtocolExec {
 
     @Before
     public void setup() throws Exception {
-        MockitoAnnotations.initMocks(this);
         protocolExec = new ProtocolExec(httpProcessor, targetAuthStrategy, proxyAuthStrategy);
         target = new HttpHost("foo", 80);
         proxy = new HttpHost("bar", 8888);
@@ -323,11 +324,6 @@ public class TestProtocolExec {
                     return response1;
                 });
 
-        Mockito.when(targetAuthStrategy.select(
-                Mockito.eq(ChallengeType.TARGET),
-                Mockito.<Map<String, AuthChallenge>>any(),
-                Mockito.<HttpClientContext>any())).thenReturn(Collections.<AuthScheme>singletonList(new BasicScheme()));
-
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, execRuntime, context);
         final ClassicHttpResponse response = protocolExec.execute(request, scope, chain);
         Assert.assertEquals(401, response.getCode());
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestResponseEntityProxy.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestResponseEntityProxy.java
index 0819887..8f7dce7 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestResponseEntityProxy.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestResponseEntityProxy.java
@@ -27,6 +27,10 @@
 
 package org.apache.hc.client5.http.impl.classic;
 
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.List;
+
 import org.apache.hc.client5.http.classic.ExecRuntime;
 import org.apache.hc.core5.function.Supplier;
 import org.apache.hc.core5.http.ClassicHttpResponse;
@@ -38,15 +42,13 @@ import org.apache.hc.core5.http.io.SessionInputBuffer;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.util.List;
+import org.mockito.junit.MockitoJUnitRunner;
 
+@RunWith(MockitoJUnitRunner.class)
 public class TestResponseEntityProxy {
 
     @Mock
@@ -58,7 +60,6 @@ public class TestResponseEntityProxy {
 
     @Before
     public void setUp() {
-        MockitoAnnotations.initMocks(this);
         Mockito.when(entity.isStreaming()).thenReturn(Boolean.TRUE);
         Mockito.when(response.getEntity()).thenReturn(entity);
     }
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestBasicHttpClientConnectionManager.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestBasicHttpClientConnectionManager.java
index 1e603e3..cd0795f 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestBasicHttpClientConnectionManager.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestBasicHttpClientConnectionManager.java
@@ -51,11 +51,13 @@ import org.apache.hc.core5.util.Timeout;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
+import org.mockito.junit.MockitoJUnitRunner;
 
 @SuppressWarnings({"boxing","static-access"}) // test code
+@RunWith(MockitoJUnitRunner.class)
 public class TestBasicHttpClientConnectionManager {
 
     @Mock
@@ -79,7 +81,6 @@ public class TestBasicHttpClientConnectionManager {
 
     @Before
     public void setup() throws Exception {
-        MockitoAnnotations.initMocks(this);
         mgr = new BasicHttpClientConnectionManager(
                 socketFactoryRegistry, connFactory, schemePortResolver, dnsResolver);
     }
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestPoolingHttpClientConnectionManager.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestPoolingHttpClientConnectionManager.java
index 7945dd1..d0e0c04 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestPoolingHttpClientConnectionManager.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestPoolingHttpClientConnectionManager.java
@@ -56,14 +56,16 @@ import org.apache.hc.core5.util.Timeout;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
+import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
+import org.mockito.junit.MockitoJUnitRunner;
 
 /**
  * {@link PoolingHttpClientConnectionManager} tests.
  */
 @SuppressWarnings({"boxing","static-access","resource"}) // test code
+@RunWith(MockitoJUnitRunner.class)
 public class TestPoolingHttpClientConnectionManager {
 
     @Mock
@@ -88,7 +90,6 @@ public class TestPoolingHttpClientConnectionManager {
 
     @Before
     public void setup() throws Exception {
-        MockitoAnnotations.initMocks(this);
         mgr = new PoolingHttpClientConnectionManager(
                 new DefaultHttpClientConnectionOperator(socketFactoryRegistry, schemePortResolver, dnsResolver), pool, null);
     }
@@ -102,9 +103,6 @@ public class TestPoolingHttpClientConnectionManager {
         entry.assignConnection(conn);
 
         Mockito.when(future.isCancelled()).thenReturn(Boolean.FALSE);
-        Mockito.when(socketFactoryRegistry.lookup("http")).thenReturn(plainSocketFactory);
-        Mockito.when(schemePortResolver.resolve(target)).thenReturn(80);
-        Mockito.when(plainSocketFactory.createSocket(Mockito.<HttpContext>any())).thenReturn(socket);
 
         Mockito.when(conn.isOpen()).thenReturn(true);
         Mockito.when(conn.isConsistent()).thenReturn(true);
@@ -135,11 +133,7 @@ public class TestPoolingHttpClientConnectionManager {
         final PoolEntry<HttpRoute, ManagedHttpClientConnection> entry = new PoolEntry<>(route, TimeValue.NEG_ONE_MILLISECOND);
 
         Mockito.when(future.isCancelled()).thenReturn(Boolean.FALSE);
-        Mockito.when(socketFactoryRegistry.lookup("http")).thenReturn(plainSocketFactory);
-        Mockito.when(schemePortResolver.resolve(target)).thenReturn(80);
-        Mockito.when(plainSocketFactory.createSocket(Mockito.<HttpContext>any())).thenReturn(socket);
 
-        Mockito.when(conn.isOpen()).thenReturn(true);
         Mockito.when(future.isCancelled()).thenReturn(false);
         Mockito.when(future.get(1, TimeUnit.SECONDS)).thenReturn(entry);
         Mockito.when(pool.lease(
@@ -185,7 +179,6 @@ public class TestPoolingHttpClientConnectionManager {
         final HttpHost target = new HttpHost("localhost", 80);
         final HttpRoute route = new HttpRoute(target);
 
-        Mockito.when(future.isCancelled()).thenReturn(Boolean.TRUE);
         Mockito.when(future.get(1, TimeUnit.SECONDS)).thenThrow(new TimeoutException());
         Mockito.when(pool.lease(
                 Mockito.eq(route),
diff --git a/pom.xml b/pom.xml
index e79ce95..788a993 100644
--- a/pom.xml
+++ b/pom.xml
@@ -71,7 +71,7 @@
     <slf4j.version>1.7.25</slf4j.version>
     <junit.version>4.12</junit.version>
     <easymock.version>3.6</easymock.version>
-    <mockito.version>2.23.0</mockito.version>
+    <mockito.version>3.10.0</mockito.version>
     <jna.version>5.2.0</jna.version>
     <hc.stylecheck.version>1</hc.stylecheck.version>
     <rxjava.version>2.2.7</rxjava.version>

[httpcomponents-client] 02/02: Redundant type declarations

Posted by ol...@apache.org.
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-client.git

commit 8580d7fddfeede3e6dc0d2c68d767b62fb23b385
Author: Oleg Kalnichevski <ol...@apache.org>
AuthorDate: Mon May 24 14:43:18 2021 +0200

    Redundant type declarations
---
 .../TestAbstractSerializingAsyncCacheStorage.java  |  84 ++++++++---------
 .../cache/TestAbstractSerializingCacheStorage.java |  22 ++---
 .../http/impl/cache/TestCacheRevalidatorBase.java  |   8 +-
 .../cache/TestDefaultAsyncCacheInvalidator.java    | 102 ++++++++++-----------
 .../impl/cache/TestDefaultCacheInvalidator.java    |   2 +-
 .../testing/async/TestHttp1RequestReExecution.java |  30 ++----
 .../hc/client5/testing/sync/TestSPNegoScheme.java  |  12 +--
 .../java/org/apache/hc/client5/http/HttpRoute.java |   6 +-
 .../hc/client5/http/entity/mime/MimeField.java     |   2 +-
 .../http/entity/mime/MultipartEntityBuilder.java   |   2 +-
 .../http/impl/cookie/RFC6265CookieSpec.java        |   2 +-
 .../hc/client5/http/psl/PublicSuffixList.java      |   2 +-
 .../apache/hc/client5/http/entity/TestGZip.java    |   2 +-
 .../http/entity/mime/TestMultipartForm.java        |  14 +--
 .../http/entity/mime/TestMultipartMixed.java       |  14 +--
 .../http/impl/TestAuthenticationStrategy.java      |   6 +-
 .../http/impl/TestIdleConnectionEvictor.java       |   2 +-
 .../http/impl/auth/TestHttpAuthenticator.java      |  10 +-
 .../auth/TestSystemDefaultCredentialsProvider.java |   8 +-
 .../client5/http/impl/classic/TestConnectExec.java |  60 ++++++------
 .../impl/classic/TestHttpRequestRetryExec.java     |  77 ++++++++--------
 .../http/impl/classic/TestInternalExecRuntime.java |  61 ++++++------
 .../http/impl/classic/TestInternalHttpClient.java  |  14 ++-
 .../http/impl/classic/TestMainClientExec.java      |  18 ++--
 .../http/impl/classic/TestProtocolExec.java        |  45 ++++-----
 .../http/impl/classic/TestRedirectExec.java        |  28 +++---
 .../http/impl/cookie/TestRFC6265CookieSpec.java    |  13 ++-
 .../io/TestBasicHttpClientConnectionManager.java   |  71 +++++++-------
 .../impl/io/TestHttpClientConnectionOperator.java  |  84 ++++++++---------
 .../io/TestPoolingHttpClientConnectionManager.java |  58 ++++++------
 .../http/impl/routing/TestDefaultRoutePlanner.java |   4 +-
 .../routing/TestSystemDefaultRoutePlanner.java     |   2 +-
 .../http/protocol/TestRequestAddCookies.java       |   4 +-
 33 files changed, 415 insertions(+), 454 deletions(-)

diff --git a/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/TestAbstractSerializingAsyncCacheStorage.java b/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/TestAbstractSerializingAsyncCacheStorage.java
index 1692054..6dc2048 100644
--- a/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/TestAbstractSerializingAsyncCacheStorage.java
+++ b/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/TestAbstractSerializingAsyncCacheStorage.java
@@ -87,8 +87,8 @@ public class TestAbstractSerializingAsyncCacheStorage {
         Mockito.when(impl.digestToStorageKey(key)).thenReturn("bar");
         Mockito.when(impl.store(
                 ArgumentMatchers.eq("bar"),
-                ArgumentMatchers.<byte[]>any(),
-                ArgumentMatchers.<FutureCallback<Boolean>>any())).thenAnswer((Answer<Cancellable>) invocation -> {
+                ArgumentMatchers.any(),
+                ArgumentMatchers.any())).thenAnswer((Answer<Cancellable>) invocation -> {
                     final FutureCallback<Boolean> callback = invocation.getArgument(2);
                     callback.completed(true);
                     return cancellable;
@@ -97,7 +97,7 @@ public class TestAbstractSerializingAsyncCacheStorage {
         impl.putEntry(key, value, operationCallback);
 
         final ArgumentCaptor<byte[]> argumentCaptor = ArgumentCaptor.forClass(byte[].class);
-        Mockito.verify(impl).store(ArgumentMatchers.eq("bar"), argumentCaptor.capture(), ArgumentMatchers.<FutureCallback<Boolean>>any());
+        Mockito.verify(impl).store(ArgumentMatchers.eq("bar"), argumentCaptor.capture(), ArgumentMatchers.any());
         Assert.assertArrayEquals(serialize(key, value), argumentCaptor.getValue());
         Mockito.verify(operationCallback).completed(Boolean.TRUE);
     }
@@ -107,7 +107,7 @@ public class TestAbstractSerializingAsyncCacheStorage {
         final String key = "foo";
 
         Mockito.when(impl.digestToStorageKey(key)).thenReturn("bar");
-        Mockito.when(impl.restore(ArgumentMatchers.eq("bar"), ArgumentMatchers.<FutureCallback<byte[]>>any())).thenAnswer((Answer<Cancellable>) invocation -> {
+        Mockito.when(impl.restore(ArgumentMatchers.eq("bar"), ArgumentMatchers.any())).thenAnswer((Answer<Cancellable>) invocation -> {
             final FutureCallback<byte[]> callback = invocation.getArgument(1);
             callback.completed(null);
             return cancellable;
@@ -117,7 +117,7 @@ public class TestAbstractSerializingAsyncCacheStorage {
         final ArgumentCaptor<HttpCacheEntry> argumentCaptor = ArgumentCaptor.forClass(HttpCacheEntry.class);
         Mockito.verify(cacheEntryCallback).completed(argumentCaptor.capture());
         Assert.assertThat(argumentCaptor.getValue(), CoreMatchers.nullValue());
-        Mockito.verify(impl).restore(ArgumentMatchers.eq("bar"), ArgumentMatchers.<FutureCallback<byte[]>>any());
+        Mockito.verify(impl).restore(ArgumentMatchers.eq("bar"), ArgumentMatchers.any());
     }
 
     @Test
@@ -126,7 +126,7 @@ public class TestAbstractSerializingAsyncCacheStorage {
         final HttpCacheEntry value = HttpTestUtils.makeCacheEntry();
 
         Mockito.when(impl.digestToStorageKey(key)).thenReturn("bar");
-        Mockito.when(impl.restore(ArgumentMatchers.eq("bar"), ArgumentMatchers.<FutureCallback<byte[]>>any())).thenAnswer((Answer<Cancellable>) invocation -> {
+        Mockito.when(impl.restore(ArgumentMatchers.eq("bar"), ArgumentMatchers.any())).thenAnswer((Answer<Cancellable>) invocation -> {
             final FutureCallback<byte[]> callback = invocation.getArgument(1);
             callback.completed(serialize(key, value));
             return cancellable;
@@ -137,7 +137,7 @@ public class TestAbstractSerializingAsyncCacheStorage {
         Mockito.verify(cacheEntryCallback).completed(argumentCaptor.capture());
         final HttpCacheEntry resultingEntry = argumentCaptor.getValue();
         Assert.assertThat(resultingEntry, HttpCacheEntryMatcher.equivalent(value));
-        Mockito.verify(impl).restore(ArgumentMatchers.eq("bar"), ArgumentMatchers.<FutureCallback<byte[]>>any());
+        Mockito.verify(impl).restore(ArgumentMatchers.eq("bar"), ArgumentMatchers.any());
     }
 
     @Test
@@ -145,7 +145,7 @@ public class TestAbstractSerializingAsyncCacheStorage {
         final String key = "foo";
         final HttpCacheEntry value = HttpTestUtils.makeCacheEntry();
         Mockito.when(impl.digestToStorageKey(key)).thenReturn("bar");
-        Mockito.when(impl.restore(ArgumentMatchers.eq("bar"), ArgumentMatchers.<FutureCallback<byte[]>>any())).thenAnswer((Answer<Cancellable>) invocation -> {
+        Mockito.when(impl.restore(ArgumentMatchers.eq("bar"), ArgumentMatchers.any())).thenAnswer((Answer<Cancellable>) invocation -> {
             final FutureCallback<byte[]> callback = invocation.getArgument(1);
             callback.completed(serialize("not-foo", value));
             return cancellable;
@@ -155,7 +155,7 @@ public class TestAbstractSerializingAsyncCacheStorage {
         final ArgumentCaptor<HttpCacheEntry> argumentCaptor = ArgumentCaptor.forClass(HttpCacheEntry.class);
         Mockito.verify(cacheEntryCallback).completed(argumentCaptor.capture());
         Assert.assertThat(argumentCaptor.getValue(), CoreMatchers.nullValue());
-        Mockito.verify(impl).restore(ArgumentMatchers.eq("bar"), ArgumentMatchers.<FutureCallback<byte[]>>any());
+        Mockito.verify(impl).restore(ArgumentMatchers.eq("bar"), ArgumentMatchers.any());
     }
 
     @Test
@@ -165,7 +165,7 @@ public class TestAbstractSerializingAsyncCacheStorage {
         Mockito.when(impl.digestToStorageKey(key)).thenReturn("bar");
         Mockito.when(impl.delete(
                 ArgumentMatchers.eq("bar"),
-                ArgumentMatchers.<FutureCallback<Boolean>>any())).thenAnswer((Answer<Cancellable>) invocation -> {
+                ArgumentMatchers.any())).thenAnswer((Answer<Cancellable>) invocation -> {
                     final FutureCallback<Boolean> callback = invocation.getArgument(1);
                     callback.completed(true);
                     return cancellable;
@@ -182,15 +182,15 @@ public class TestAbstractSerializingAsyncCacheStorage {
         final HttpCacheEntry updatedValue = HttpTestUtils.makeCacheEntry();
 
         Mockito.when(impl.digestToStorageKey(key)).thenReturn("bar");
-        Mockito.when(impl.getForUpdateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.<FutureCallback<String>>any())).thenAnswer((Answer<Cancellable>) invocation -> {
+        Mockito.when(impl.getForUpdateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.any())).thenAnswer((Answer<Cancellable>) invocation -> {
             final FutureCallback<byte[]> callback = invocation.getArgument(1);
             callback.completed(null);
             return cancellable;
         });
         Mockito.when(impl.store(
                 ArgumentMatchers.eq("bar"),
-                ArgumentMatchers.<byte[]>any(),
-                ArgumentMatchers.<FutureCallback<Boolean>>any())).thenAnswer((Answer<Cancellable>) invocation -> {
+                ArgumentMatchers.any(),
+                ArgumentMatchers.any())).thenAnswer((Answer<Cancellable>) invocation -> {
                     final FutureCallback<Boolean> callback = invocation.getArgument(2);
                     callback.completed(true);
                     return cancellable;
@@ -201,8 +201,8 @@ public class TestAbstractSerializingAsyncCacheStorage {
             return updatedValue;
         }, operationCallback);
 
-        Mockito.verify(impl).getForUpdateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.<FutureCallback<String>>any());
-        Mockito.verify(impl).store(ArgumentMatchers.eq("bar"), ArgumentMatchers.<byte[]>any(), ArgumentMatchers.<FutureCallback<Boolean>>any());
+        Mockito.verify(impl).getForUpdateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.any());
+        Mockito.verify(impl).store(ArgumentMatchers.eq("bar"), ArgumentMatchers.any(), ArgumentMatchers.any());
         Mockito.verify(operationCallback).completed(Boolean.TRUE);
     }
 
@@ -213,7 +213,7 @@ public class TestAbstractSerializingAsyncCacheStorage {
         final HttpCacheEntry updatedValue = HttpTestUtils.makeCacheEntry();
 
         Mockito.when(impl.digestToStorageKey(key)).thenReturn("bar");
-        Mockito.when(impl.getForUpdateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.<FutureCallback<String>>any())).thenAnswer((Answer<Cancellable>) invocation -> {
+        Mockito.when(impl.getForUpdateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.any())).thenAnswer((Answer<Cancellable>) invocation -> {
             final FutureCallback<String> callback = invocation.getArgument(1);
             callback.completed("stuff");
             return cancellable;
@@ -222,8 +222,8 @@ public class TestAbstractSerializingAsyncCacheStorage {
         Mockito.when(impl.updateCAS(
                 ArgumentMatchers.eq("bar"),
                 ArgumentMatchers.eq("stuff"),
-                ArgumentMatchers.<byte[]>any(),
-                ArgumentMatchers.<FutureCallback<Boolean>>any())).thenAnswer((Answer<Cancellable>) invocation -> {
+                ArgumentMatchers.any(),
+                ArgumentMatchers.any())).thenAnswer((Answer<Cancellable>) invocation -> {
                     final FutureCallback<Boolean> callback = invocation.getArgument(3);
                     callback.completed(true);
                     return cancellable;
@@ -231,9 +231,9 @@ public class TestAbstractSerializingAsyncCacheStorage {
 
         impl.updateEntry(key, existing -> updatedValue, operationCallback);
 
-        Mockito.verify(impl).getForUpdateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.<FutureCallback<String>>any());
+        Mockito.verify(impl).getForUpdateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.any());
         Mockito.verify(impl).getStorageObject("stuff");
-        Mockito.verify(impl).updateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.eq("stuff"), ArgumentMatchers.<byte[]>any(), ArgumentMatchers.<FutureCallback<Boolean>>any());
+        Mockito.verify(impl).updateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.eq("stuff"), ArgumentMatchers.any(), ArgumentMatchers.any());
         Mockito.verify(operationCallback).completed(Boolean.TRUE);
     }
 
@@ -244,7 +244,7 @@ public class TestAbstractSerializingAsyncCacheStorage {
         final HttpCacheEntry updatedValue = HttpTestUtils.makeCacheEntry();
 
         Mockito.when(impl.digestToStorageKey(key)).thenReturn("bar");
-        Mockito.when(impl.getForUpdateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.<FutureCallback<String>>any())).thenAnswer(
+        Mockito.when(impl.getForUpdateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.any())).thenAnswer(
                 (Answer<Cancellable>) invocation -> {
                     final FutureCallback<String> callback = invocation.getArgument(1);
                     callback.completed("stuff");
@@ -253,8 +253,8 @@ public class TestAbstractSerializingAsyncCacheStorage {
         Mockito.when(impl.getStorageObject("stuff")).thenReturn(serialize("not-foo", existingValue));
         Mockito.when(impl.store(
                 ArgumentMatchers.eq("bar"),
-                ArgumentMatchers.<byte[]>any(),
-                ArgumentMatchers.<FutureCallback<Boolean>>any())).thenAnswer((Answer<Cancellable>) invocation -> {
+                ArgumentMatchers.any(),
+                ArgumentMatchers.any())).thenAnswer((Answer<Cancellable>) invocation -> {
                     final FutureCallback<Boolean> callback = invocation.getArgument(2);
                     callback.completed(true);
                     return cancellable;
@@ -265,11 +265,11 @@ public class TestAbstractSerializingAsyncCacheStorage {
             return updatedValue;
         }, operationCallback);
 
-        Mockito.verify(impl).getForUpdateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.<FutureCallback<String>>any());
+        Mockito.verify(impl).getForUpdateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.any());
         Mockito.verify(impl).getStorageObject("stuff");
         Mockito.verify(impl, Mockito.never()).updateCAS(
-                ArgumentMatchers.eq("bar"), ArgumentMatchers.eq("stuff"), ArgumentMatchers.<byte[]>any(), ArgumentMatchers.<FutureCallback<Boolean>>any());
-        Mockito.verify(impl).store(ArgumentMatchers.eq("bar"), ArgumentMatchers.<byte[]>any(), ArgumentMatchers.<FutureCallback<Boolean>>any());
+                ArgumentMatchers.eq("bar"), ArgumentMatchers.eq("stuff"), ArgumentMatchers.any(), ArgumentMatchers.any());
+        Mockito.verify(impl).store(ArgumentMatchers.eq("bar"), ArgumentMatchers.any(), ArgumentMatchers.any());
         Mockito.verify(operationCallback).completed(Boolean.TRUE);
     }
 
@@ -280,7 +280,7 @@ public class TestAbstractSerializingAsyncCacheStorage {
         final HttpCacheEntry updatedValue = HttpTestUtils.makeCacheEntry();
 
         Mockito.when(impl.digestToStorageKey(key)).thenReturn("bar");
-        Mockito.when(impl.getForUpdateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.<FutureCallback<String>>any())).thenAnswer(
+        Mockito.when(impl.getForUpdateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.any())).thenAnswer(
                 (Answer<Cancellable>) invocation -> {
                     final FutureCallback<String> callback = invocation.getArgument(1);
                     callback.completed("stuff");
@@ -291,8 +291,8 @@ public class TestAbstractSerializingAsyncCacheStorage {
         Mockito.when(impl.updateCAS(
                 ArgumentMatchers.eq("bar"),
                 ArgumentMatchers.eq("stuff"),
-                ArgumentMatchers.<byte[]>any(),
-                ArgumentMatchers.<FutureCallback<Boolean>>any())).thenAnswer((Answer<Cancellable>) invocation -> {
+                ArgumentMatchers.any(),
+                ArgumentMatchers.any())).thenAnswer((Answer<Cancellable>) invocation -> {
                     final FutureCallback<Boolean> callback = invocation.getArgument(3);
                     if (count.incrementAndGet() == 1) {
                         callback.completed(false);
@@ -304,10 +304,10 @@ public class TestAbstractSerializingAsyncCacheStorage {
 
         impl.updateEntry(key, existing -> updatedValue, operationCallback);
 
-        Mockito.verify(impl, Mockito.times(2)).getForUpdateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.<FutureCallback<String>>any());
+        Mockito.verify(impl, Mockito.times(2)).getForUpdateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.any());
         Mockito.verify(impl, Mockito.times(2)).getStorageObject("stuff");
         Mockito.verify(impl, Mockito.times(2)).updateCAS(
-                ArgumentMatchers.eq("bar"), ArgumentMatchers.eq("stuff"), ArgumentMatchers.<byte[]>any(), ArgumentMatchers.<FutureCallback<Boolean>>any());
+                ArgumentMatchers.eq("bar"), ArgumentMatchers.eq("stuff"), ArgumentMatchers.any(), ArgumentMatchers.any());
         Mockito.verify(operationCallback).completed(Boolean.TRUE);
     }
 
@@ -318,7 +318,7 @@ public class TestAbstractSerializingAsyncCacheStorage {
         final HttpCacheEntry updatedValue = HttpTestUtils.makeCacheEntry();
 
         Mockito.when(impl.digestToStorageKey(key)).thenReturn("bar");
-        Mockito.when(impl.getForUpdateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.<FutureCallback<String>>any())).thenAnswer(
+        Mockito.when(impl.getForUpdateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.any())).thenAnswer(
                 (Answer<Cancellable>) invocation -> {
                     final FutureCallback<String> callback = invocation.getArgument(1);
                     callback.completed("stuff");
@@ -329,8 +329,8 @@ public class TestAbstractSerializingAsyncCacheStorage {
         Mockito.when(impl.updateCAS(
                 ArgumentMatchers.eq("bar"),
                 ArgumentMatchers.eq("stuff"),
-                ArgumentMatchers.<byte[]>any(),
-                ArgumentMatchers.<FutureCallback<Boolean>>any())).thenAnswer((Answer<Cancellable>) invocation -> {
+                ArgumentMatchers.any(),
+                ArgumentMatchers.any())).thenAnswer((Answer<Cancellable>) invocation -> {
                     final FutureCallback<Boolean> callback = invocation.getArgument(3);
                     if (count.incrementAndGet() <= 3) {
                         callback.completed(false);
@@ -342,10 +342,10 @@ public class TestAbstractSerializingAsyncCacheStorage {
 
         impl.updateEntry(key, existing -> updatedValue, operationCallback);
 
-        Mockito.verify(impl, Mockito.times(3)).getForUpdateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.<FutureCallback<String>>any());
+        Mockito.verify(impl, Mockito.times(3)).getForUpdateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.any());
         Mockito.verify(impl, Mockito.times(3)).getStorageObject("stuff");
         Mockito.verify(impl, Mockito.times(3)).updateCAS(
-                ArgumentMatchers.eq("bar"), ArgumentMatchers.eq("stuff"), ArgumentMatchers.<byte[]>any(), ArgumentMatchers.<FutureCallback<Boolean>>any());
+                ArgumentMatchers.eq("bar"), ArgumentMatchers.eq("stuff"), ArgumentMatchers.any(), ArgumentMatchers.any());
         Mockito.verify(operationCallback).failed(ArgumentMatchers.<HttpCacheUpdateException>any());
     }
 
@@ -363,8 +363,8 @@ public class TestAbstractSerializingAsyncCacheStorage {
         when(impl.digestToStorageKey(key2)).thenReturn(storageKey2);
 
         when(impl.bulkRestore(
-                ArgumentMatchers.<String>anyCollection(),
-                ArgumentMatchers.<FutureCallback<Map<String, byte[]>>>any())).thenAnswer((Answer<Cancellable>) invocation -> {
+                ArgumentMatchers.anyCollection(),
+                ArgumentMatchers.any())).thenAnswer((Answer<Cancellable>) invocation -> {
                     final Collection<String> keys = invocation.getArgument(0);
                     final FutureCallback<Map<String, byte[]>> callback = invocation.getArgument(1);
                     final Map<String, byte[]> resultMap = new HashMap<>();
@@ -391,7 +391,7 @@ public class TestAbstractSerializingAsyncCacheStorage {
         verify(impl, Mockito.times(2)).digestToStorageKey(key2);
         verify(impl).bulkRestore(
                 ArgumentMatchers.eq(Arrays.asList(storageKey1, storageKey2)),
-                ArgumentMatchers.<FutureCallback<Map<String, byte[]>>>any());
+                ArgumentMatchers.any());
     }
 
     @Test
@@ -408,8 +408,8 @@ public class TestAbstractSerializingAsyncCacheStorage {
         when(impl.digestToStorageKey(key2)).thenReturn(storageKey2);
 
         when(impl.bulkRestore(
-                ArgumentMatchers.<String>anyCollection(),
-                ArgumentMatchers.<FutureCallback<Map<String, byte[]>>>any())).thenAnswer((Answer<Cancellable>) invocation -> {
+                ArgumentMatchers.anyCollection(),
+                ArgumentMatchers.any())).thenAnswer((Answer<Cancellable>) invocation -> {
                     final Collection<String> keys = invocation.getArgument(0);
                     final FutureCallback<Map<String, byte[]>> callback = invocation.getArgument(1);
                     final Map<String, byte[]> resultMap = new HashMap<>();
@@ -436,7 +436,7 @@ public class TestAbstractSerializingAsyncCacheStorage {
         verify(impl, Mockito.times(2)).digestToStorageKey(key2);
         verify(impl).bulkRestore(
                 ArgumentMatchers.eq(Arrays.asList(storageKey1, storageKey2)),
-                ArgumentMatchers.<FutureCallback<Map<String, byte[]>>>any());
+                ArgumentMatchers.any());
     }
 
 }
diff --git a/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/TestAbstractSerializingCacheStorage.java b/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/TestAbstractSerializingCacheStorage.java
index 1cbbaae..db4c690 100644
--- a/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/TestAbstractSerializingCacheStorage.java
+++ b/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/TestAbstractSerializingCacheStorage.java
@@ -147,7 +147,7 @@ public class TestAbstractSerializingCacheStorage {
         });
 
         verify(impl).getForUpdateCAS("bar");
-        verify(impl).store(ArgumentMatchers.eq("bar"), ArgumentMatchers.<byte[]>any());
+        verify(impl).store(ArgumentMatchers.eq("bar"), ArgumentMatchers.any());
     }
 
     @Test
@@ -159,13 +159,13 @@ public class TestAbstractSerializingCacheStorage {
         when(impl.digestToStorageKey(key)).thenReturn("bar");
         when(impl.getForUpdateCAS("bar")).thenReturn("stuff");
         when(impl.getStorageObject("stuff")).thenReturn(serialize(key, existingValue));
-        when(impl.updateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.eq("stuff"), ArgumentMatchers.<byte[]>any())).thenReturn(true);
+        when(impl.updateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.eq("stuff"), ArgumentMatchers.any())).thenReturn(true);
 
         impl.updateEntry(key, existing -> updatedValue);
 
         verify(impl).getForUpdateCAS("bar");
         verify(impl).getStorageObject("stuff");
-        verify(impl).updateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.eq("stuff"), ArgumentMatchers.<byte[]>any());
+        verify(impl).updateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.eq("stuff"), ArgumentMatchers.any());
     }
 
     @Test
@@ -177,7 +177,7 @@ public class TestAbstractSerializingCacheStorage {
         when(impl.digestToStorageKey(key)).thenReturn("bar");
         when(impl.getForUpdateCAS("bar")).thenReturn("stuff");
         when(impl.getStorageObject("stuff")).thenReturn(serialize("not-foo", existingValue));
-        when(impl.updateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.eq("stuff"), ArgumentMatchers.<byte[]>any())).thenReturn(true);
+        when(impl.updateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.eq("stuff"), ArgumentMatchers.any())).thenReturn(true);
 
         impl.updateEntry(key, existing -> {
             Assert.assertThat(existing, CoreMatchers.nullValue());
@@ -186,7 +186,7 @@ public class TestAbstractSerializingCacheStorage {
 
         verify(impl).getForUpdateCAS("bar");
         verify(impl).getStorageObject("stuff");
-        verify(impl).store(ArgumentMatchers.eq("bar"), ArgumentMatchers.<byte[]>any());
+        verify(impl).store(ArgumentMatchers.eq("bar"), ArgumentMatchers.any());
     }
 
     @Test
@@ -198,13 +198,13 @@ public class TestAbstractSerializingCacheStorage {
         when(impl.digestToStorageKey(key)).thenReturn("bar");
         when(impl.getForUpdateCAS("bar")).thenReturn("stuff");
         when(impl.getStorageObject("stuff")).thenReturn(serialize(key, existingValue));
-        when(impl.updateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.eq("stuff"), ArgumentMatchers.<byte[]>any())).thenReturn(false, true);
+        when(impl.updateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.eq("stuff"), ArgumentMatchers.any())).thenReturn(false, true);
 
         impl.updateEntry(key, existing -> updatedValue);
 
         verify(impl, Mockito.times(2)).getForUpdateCAS("bar");
         verify(impl, Mockito.times(2)).getStorageObject("stuff");
-        verify(impl, Mockito.times(2)).updateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.eq("stuff"), ArgumentMatchers.<byte[]>any());
+        verify(impl, Mockito.times(2)).updateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.eq("stuff"), ArgumentMatchers.any());
     }
 
     @Test
@@ -216,7 +216,7 @@ public class TestAbstractSerializingCacheStorage {
         when(impl.digestToStorageKey(key)).thenReturn("bar");
         when(impl.getForUpdateCAS("bar")).thenReturn("stuff");
         when(impl.getStorageObject("stuff")).thenReturn(serialize(key, existingValue));
-        when(impl.updateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.eq("stuff"), ArgumentMatchers.<byte[]>any())).thenReturn(false, false, false, true);
+        when(impl.updateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.eq("stuff"), ArgumentMatchers.any())).thenReturn(false, false, false, true);
 
         try {
             impl.updateEntry(key, existing -> updatedValue);
@@ -226,7 +226,7 @@ public class TestAbstractSerializingCacheStorage {
 
         verify(impl, Mockito.times(3)).getForUpdateCAS("bar");
         verify(impl, Mockito.times(3)).getStorageObject("stuff");
-        verify(impl, Mockito.times(3)).updateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.eq("stuff"), ArgumentMatchers.<byte[]>any());
+        verify(impl, Mockito.times(3)).updateCAS(ArgumentMatchers.eq("bar"), ArgumentMatchers.eq("stuff"), ArgumentMatchers.any());
     }
 
     @Test
@@ -241,7 +241,7 @@ public class TestAbstractSerializingCacheStorage {
         when(impl.digestToStorageKey(key1)).thenReturn(storageKey1);
         when(impl.digestToStorageKey(key2)).thenReturn(storageKey2);
 
-        when(impl.bulkRestore(ArgumentMatchers.<String>anyCollection())).thenAnswer((Answer<Map<String, byte[]>>) invocation -> {
+        when(impl.bulkRestore(ArgumentMatchers.anyCollection())).thenAnswer((Answer<Map<String, byte[]>>) invocation -> {
             final Collection<String> keys = invocation.getArgument(0);
             final Map<String, byte[]> resultMap = new HashMap<>();
             if (keys.contains(storageKey1)) {
@@ -275,7 +275,7 @@ public class TestAbstractSerializingCacheStorage {
         when(impl.digestToStorageKey(key1)).thenReturn(storageKey1);
         when(impl.digestToStorageKey(key2)).thenReturn(storageKey2);
 
-        when(impl.bulkRestore(ArgumentMatchers.<String>anyCollection())).thenAnswer((Answer<Map<String, byte[]>>) invocation -> {
+        when(impl.bulkRestore(ArgumentMatchers.anyCollection())).thenAnswer((Answer<Map<String, byte[]>>) invocation -> {
             final Collection<String> keys = invocation.getArgument(0);
             final Map<String, byte[]> resultMap = new HashMap<>();
             if (keys.contains(storageKey1)) {
diff --git a/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/TestCacheRevalidatorBase.java b/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/TestCacheRevalidatorBase.java
index f4dd4c5..787a022 100644
--- a/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/TestCacheRevalidatorBase.java
+++ b/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/TestCacheRevalidatorBase.java
@@ -87,7 +87,7 @@ public class TestCacheRevalidatorBase {
         impl.scheduleRevalidation(cacheKey, mockOperation);
 
         verify(mockSchedulingStrategy).schedule(0);
-        verify(mockScheduledExecutor).schedule(ArgumentMatchers.<Runnable>any(), ArgumentMatchers.eq(TimeValue.ofSeconds(3)));
+        verify(mockScheduledExecutor).schedule(ArgumentMatchers.any(), ArgumentMatchers.eq(TimeValue.ofSeconds(3)));
 
         Assert.assertEquals(1, impl.getScheduledIdentifiers().size());
         Assert.assertTrue(impl.getScheduledIdentifiers().contains(cacheKey));
@@ -100,13 +100,13 @@ public class TestCacheRevalidatorBase {
     @Test
     public void testRevalidateCacheEntryDoesNotPopulateIdentifierOnRejectedExecutionException() {
         when(mockSchedulingStrategy.schedule(ArgumentMatchers.anyInt())).thenReturn(TimeValue.ofSeconds(2));
-        doThrow(new RejectedExecutionException()).when(mockScheduledExecutor).schedule(ArgumentMatchers.<Runnable>any(), ArgumentMatchers.<TimeValue>any());
+        doThrow(new RejectedExecutionException()).when(mockScheduledExecutor).schedule(ArgumentMatchers.any(), ArgumentMatchers.any());
 
         final String cacheKey = "blah";
         impl.scheduleRevalidation(cacheKey, mockOperation);
 
         Assert.assertEquals(0, impl.getScheduledIdentifiers().size());
-        verify(mockScheduledExecutor).schedule(ArgumentMatchers.<Runnable>any(), ArgumentMatchers.eq(TimeValue.ofSeconds(2)));
+        verify(mockScheduledExecutor).schedule(ArgumentMatchers.any(), ArgumentMatchers.eq(TimeValue.ofSeconds(2)));
     }
 
     @Test
@@ -119,7 +119,7 @@ public class TestCacheRevalidatorBase {
         impl.scheduleRevalidation(cacheKey, mockOperation);
 
         verify(mockSchedulingStrategy).schedule(ArgumentMatchers.anyInt());
-        verify(mockScheduledExecutor).schedule(ArgumentMatchers.<Runnable>any(), ArgumentMatchers.eq(TimeValue.ofSeconds(2)));
+        verify(mockScheduledExecutor).schedule(ArgumentMatchers.any(), ArgumentMatchers.eq(TimeValue.ofSeconds(2)));
 
         Assert.assertEquals(1, impl.getScheduledIdentifiers().size());
     }
diff --git a/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/TestDefaultAsyncCacheInvalidator.java b/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/TestDefaultAsyncCacheInvalidator.java
index 9d0589c..cffae63 100644
--- a/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/TestDefaultAsyncCacheInvalidator.java
+++ b/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/TestDefaultAsyncCacheInvalidator.java
@@ -82,7 +82,7 @@ public class TestDefaultAsyncCacheInvalidator {
         now = new Date();
         tenSecondsAgo = new Date(now.getTime() - 10 * 1000L);
 
-        when(cacheKeyResolver.resolve(ArgumentMatchers.<URI>any())).thenAnswer((Answer<String>) invocation -> {
+        when(cacheKeyResolver.resolve(ArgumentMatchers.any())).thenAnswer((Answer<String>) invocation -> {
             final URI uri = invocation.getArgument(0);
             return HttpCacheSupport.normalize(uri).toASCIIString();
         });
@@ -104,8 +104,8 @@ public class TestDefaultAsyncCacheInvalidator {
         impl.flushCacheEntriesInvalidatedByRequest(host, request, cacheKeyResolver, mockStorage, operationCallback);
 
         verify(mockEntry).getVariantMap();
-        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
-        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<Boolean>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
+        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
     }
 
     @Test
@@ -125,9 +125,9 @@ public class TestDefaultAsyncCacheInvalidator {
         impl.flushCacheEntriesInvalidatedByRequest(host, request, cacheKeyResolver, mockStorage, operationCallback);
 
         verify(mockEntry).getVariantMap();
-        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
-        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<Boolean>>any());
-        verify(mockStorage).removeEntry(ArgumentMatchers.eq("http://foo.example.com:80/content"), ArgumentMatchers.<FutureCallback<Boolean>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
+        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
+        verify(mockStorage).removeEntry(ArgumentMatchers.eq("http://foo.example.com:80/content"), ArgumentMatchers.any());
     }
 
     @Test
@@ -147,9 +147,9 @@ public class TestDefaultAsyncCacheInvalidator {
         impl.flushCacheEntriesInvalidatedByRequest(host, request, cacheKeyResolver, mockStorage, operationCallback);
 
         verify(mockEntry).getVariantMap();
-        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
-        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<Boolean>>any());
-        verify(mockStorage).removeEntry(ArgumentMatchers.eq("http://foo.example.com:80/content"), ArgumentMatchers.<FutureCallback<Boolean>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
+        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
+        verify(mockStorage).removeEntry(ArgumentMatchers.eq("http://foo.example.com:80/content"), ArgumentMatchers.any());
     }
 
     @Test
@@ -169,9 +169,9 @@ public class TestDefaultAsyncCacheInvalidator {
         impl.flushCacheEntriesInvalidatedByRequest(host, request, cacheKeyResolver, mockStorage, operationCallback);
 
         verify(mockEntry).getVariantMap();
-        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
-        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<Boolean>>any());
-        verify(mockStorage).removeEntry(ArgumentMatchers.eq("http://foo.example.com:80/content"), ArgumentMatchers.<FutureCallback<Boolean>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
+        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
+        verify(mockStorage).removeEntry(ArgumentMatchers.eq("http://foo.example.com:80/content"), ArgumentMatchers.any());
     }
 
     @Test
@@ -191,8 +191,8 @@ public class TestDefaultAsyncCacheInvalidator {
         impl.flushCacheEntriesInvalidatedByRequest(host, request, cacheKeyResolver, mockStorage, operationCallback);
 
         verify(mockEntry).getVariantMap();
-        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
-        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<Boolean>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
+        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
     }
 
     @Test
@@ -200,7 +200,7 @@ public class TestDefaultAsyncCacheInvalidator {
         final HttpRequest request = new BasicHttpRequest("GET","/");
         impl.flushCacheEntriesInvalidatedByRequest(host, request, cacheKeyResolver, mockStorage, operationCallback);
 
-        verify(mockStorage).getEntry(ArgumentMatchers.eq("http://foo.example.com:80/"), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq("http://foo.example.com:80/"), ArgumentMatchers.any());
         verifyNoMoreInteractions(mockStorage);
     }
 
@@ -209,7 +209,7 @@ public class TestDefaultAsyncCacheInvalidator {
         final HttpRequest request = new BasicHttpRequest("HEAD","/");
         impl.flushCacheEntriesInvalidatedByRequest(host, request, cacheKeyResolver, mockStorage, operationCallback);
 
-        verify(mockStorage).getEntry(ArgumentMatchers.eq("http://foo.example.com:80/"), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq("http://foo.example.com:80/"), ArgumentMatchers.any());
         verifyNoMoreInteractions(mockStorage);
     }
 
@@ -227,8 +227,8 @@ public class TestDefaultAsyncCacheInvalidator {
 
         verify(mockEntry).getRequestMethod();
         verify(mockEntry).getVariantMap();
-        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
-        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<Boolean>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
+        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
     }
 
     @Test
@@ -248,9 +248,9 @@ public class TestDefaultAsyncCacheInvalidator {
 
         verify(mockEntry).getRequestMethod();
         verify(mockEntry).getVariantMap();
-        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
-        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<Boolean>>any());
-        verify(mockStorage).removeEntry(ArgumentMatchers.eq(theVariantURI), ArgumentMatchers.<FutureCallback<Boolean>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
+        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
+        verify(mockStorage).removeEntry(ArgumentMatchers.eq(theVariantURI), ArgumentMatchers.any());
     }
 
     @Test
@@ -263,7 +263,7 @@ public class TestDefaultAsyncCacheInvalidator {
 
         impl.flushCacheEntriesInvalidatedByRequest(host, request, cacheKeyResolver, mockStorage, operationCallback);
 
-        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
         verifyNoMoreInteractions(mockStorage);
     }
 
@@ -277,7 +277,7 @@ public class TestDefaultAsyncCacheInvalidator {
 
         impl.flushCacheEntriesInvalidatedByRequest(host, request, cacheKeyResolver, mockStorage, operationCallback);
 
-        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
         verifyNoMoreInteractions(mockStorage);
     }
 
@@ -293,7 +293,7 @@ public class TestDefaultAsyncCacheInvalidator {
         impl.flushCacheEntriesInvalidatedByRequest(host, request, cacheKeyResolver, mockStorage, operationCallback);
 
         verify(mockEntry).getRequestMethod();
-        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
         verifyNoMoreInteractions(mockStorage);
     }
 
@@ -304,7 +304,7 @@ public class TestDefaultAsyncCacheInvalidator {
 
         impl.flushCacheEntriesInvalidatedByRequest(host, request, cacheKeyResolver, mockStorage, operationCallback);
 
-        verify(mockStorage).getEntry(ArgumentMatchers.eq("http://foo.example.com:80/"), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq("http://foo.example.com:80/"), ArgumentMatchers.any());
         verifyNoMoreInteractions(mockStorage);
     }
 
@@ -315,7 +315,7 @@ public class TestDefaultAsyncCacheInvalidator {
 
         impl.flushCacheEntriesInvalidatedByRequest(host, request, cacheKeyResolver, mockStorage, operationCallback);
 
-        verify(mockStorage).getEntry(ArgumentMatchers.eq("http://foo.example.com:80/"), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq("http://foo.example.com:80/"), ArgumentMatchers.any());
         verifyNoMoreInteractions(mockStorage);
     }
 
@@ -332,10 +332,10 @@ public class TestDefaultAsyncCacheInvalidator {
 
         impl.flushCacheEntriesInvalidatedByRequest(host, request, cacheKeyResolver, mockStorage, operationCallback);
 
-        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
         verify(mockEntry).getVariantMap();
-        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<Boolean>>any());
-        verify(mockStorage).removeEntry(ArgumentMatchers.eq(variantUri), ArgumentMatchers.<FutureCallback<Boolean>>any());
+        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
+        verify(mockStorage).removeEntry(ArgumentMatchers.eq(variantUri), ArgumentMatchers.any());
     }
 
     @Test
@@ -365,8 +365,8 @@ public class TestDefaultAsyncCacheInvalidator {
 
         impl.flushCacheEntriesInvalidatedByExchange(host, request, response, cacheKeyResolver, mockStorage, operationCallback);
 
-        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
-        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<Boolean>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
+        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
     }
 
     @Test
@@ -387,8 +387,8 @@ public class TestDefaultAsyncCacheInvalidator {
 
         impl.flushCacheEntriesInvalidatedByExchange(host, request, response, cacheKeyResolver, mockStorage, operationCallback);
 
-        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
-        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<Boolean>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
+        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
     }
 
     @Test
@@ -423,8 +423,8 @@ public class TestDefaultAsyncCacheInvalidator {
 
         impl.flushCacheEntriesInvalidatedByExchange(host, request, response, cacheKeyResolver, mockStorage, operationCallback);
 
-        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
-        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<Boolean>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
+        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
     }
 
     @Test
@@ -445,8 +445,8 @@ public class TestDefaultAsyncCacheInvalidator {
 
         impl.flushCacheEntriesInvalidatedByExchange(host, request, response, cacheKeyResolver, mockStorage, operationCallback);
 
-        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
-        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<Boolean>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
+        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
     }
 
     @Test
@@ -487,7 +487,7 @@ public class TestDefaultAsyncCacheInvalidator {
         cacheReturnsEntryForUri(key, entry);
         impl.flushCacheEntriesInvalidatedByExchange(host, request, response, cacheKeyResolver, mockStorage, operationCallback);
 
-        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
         verifyNoMoreInteractions(mockStorage);
     }
 
@@ -509,7 +509,7 @@ public class TestDefaultAsyncCacheInvalidator {
 
         impl.flushCacheEntriesInvalidatedByExchange(host, request, response, cacheKeyResolver, mockStorage, operationCallback);
 
-        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
         verifyNoMoreInteractions(mockStorage);
     }
 
@@ -526,7 +526,7 @@ public class TestDefaultAsyncCacheInvalidator {
 
         impl.flushCacheEntriesInvalidatedByExchange(host, request, response, cacheKeyResolver, mockStorage, operationCallback);
 
-        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
         verifyNoMoreInteractions(mockStorage);
     }
 
@@ -548,7 +548,7 @@ public class TestDefaultAsyncCacheInvalidator {
 
         impl.flushCacheEntriesInvalidatedByExchange(host, request, response, cacheKeyResolver, mockStorage, operationCallback);
 
-        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
         verifyNoMoreInteractions(mockStorage);
     }
 
@@ -569,7 +569,7 @@ public class TestDefaultAsyncCacheInvalidator {
 
         impl.flushCacheEntriesInvalidatedByExchange(host, request, response, cacheKeyResolver, mockStorage, operationCallback);
 
-        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
         verifyNoMoreInteractions(mockStorage);
     }
 
@@ -591,8 +591,8 @@ public class TestDefaultAsyncCacheInvalidator {
 
         impl.flushCacheEntriesInvalidatedByExchange(host, request, response, cacheKeyResolver, mockStorage, operationCallback);
 
-        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
-        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<Boolean>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
+        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
         verifyNoMoreInteractions(mockStorage);
     }
 
@@ -613,8 +613,8 @@ public class TestDefaultAsyncCacheInvalidator {
 
         impl.flushCacheEntriesInvalidatedByExchange(host, request, response, cacheKeyResolver, mockStorage, operationCallback);
 
-        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
-        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<Boolean>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
+        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
         verifyNoMoreInteractions(mockStorage);
     }
 
@@ -636,8 +636,8 @@ public class TestDefaultAsyncCacheInvalidator {
 
         impl.flushCacheEntriesInvalidatedByExchange(host, request, response, cacheKeyResolver, mockStorage, operationCallback);
 
-        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
-        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<Boolean>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
+        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
         verifyNoMoreInteractions(mockStorage);
     }
 
@@ -659,8 +659,8 @@ public class TestDefaultAsyncCacheInvalidator {
 
         impl.flushCacheEntriesInvalidatedByExchange(host, request, response, cacheKeyResolver, mockStorage, operationCallback);
 
-        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any());
-        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.<FutureCallback<Boolean>>any());
+        verify(mockStorage).getEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
+        verify(mockStorage).removeEntry(ArgumentMatchers.eq(key), ArgumentMatchers.any());
         verifyNoMoreInteractions(mockStorage);
     }
 
@@ -673,7 +673,7 @@ public class TestDefaultAsyncCacheInvalidator {
     private void cacheReturnsEntryForUri(final String key, final HttpCacheEntry cacheEntry) {
         Mockito.when(mockStorage.getEntry(
                 ArgumentMatchers.eq(key),
-                ArgumentMatchers.<FutureCallback<HttpCacheEntry>>any())).thenAnswer((Answer<Cancellable>) invocation -> {
+                ArgumentMatchers.any())).thenAnswer((Answer<Cancellable>) invocation -> {
                     final FutureCallback<HttpCacheEntry> callback = invocation.getArgument(1);
                     callback.completed(cacheEntry);
                     return cancellable;
diff --git a/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/TestDefaultCacheInvalidator.java b/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/TestDefaultCacheInvalidator.java
index e97422c..1a07d3e 100644
--- a/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/TestDefaultCacheInvalidator.java
+++ b/httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/TestDefaultCacheInvalidator.java
@@ -76,7 +76,7 @@ public class TestDefaultCacheInvalidator {
         now = new Date();
         tenSecondsAgo = new Date(now.getTime() - 10 * 1000L);
 
-        when(cacheKeyResolver.resolve(ArgumentMatchers.<URI>any())).thenAnswer((Answer<String>) invocation -> {
+        when(cacheKeyResolver.resolve(ArgumentMatchers.any())).thenAnswer((Answer<String>) invocation -> {
             final URI uri = invocation.getArgument(0);
             return HttpCacheSupport.normalize(uri).toASCIIString();
         });
diff --git a/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/async/TestHttp1RequestReExecution.java b/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/async/TestHttp1RequestReExecution.java
index 88aeb84..c6d4b99 100644
--- a/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/async/TestHttp1RequestReExecution.java
+++ b/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/async/TestHttp1RequestReExecution.java
@@ -26,6 +26,11 @@
  */
 package org.apache.hc.client5.testing.async;
 
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.concurrent.Future;
+import java.util.concurrent.atomic.AtomicInteger;
+
 import org.apache.hc.client5.http.async.methods.SimpleHttpResponse;
 import org.apache.hc.client5.http.async.methods.SimpleRequestBuilder;
 import org.apache.hc.client5.http.config.RequestConfig;
@@ -34,7 +39,6 @@ import org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient;
 import org.apache.hc.client5.http.impl.async.HttpAsyncClientBuilder;
 import org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManager;
 import org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManagerBuilder;
-import org.apache.hc.core5.function.Decorator;
 import org.apache.hc.core5.function.Resolver;
 import org.apache.hc.core5.http.HttpHost;
 import org.apache.hc.core5.http.HttpRequest;
@@ -42,7 +46,6 @@ import org.apache.hc.core5.http.HttpStatus;
 import org.apache.hc.core5.http.HttpVersion;
 import org.apache.hc.core5.http.URIScheme;
 import org.apache.hc.core5.http.config.Http1Config;
-import org.apache.hc.core5.http.nio.AsyncServerExchangeHandler;
 import org.apache.hc.core5.http2.HttpVersionPolicy;
 import org.apache.hc.core5.http2.config.H2Config;
 import org.apache.hc.core5.util.TimeValue;
@@ -54,11 +57,6 @@ import org.junit.rules.ExternalResource;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.concurrent.Future;
-import java.util.concurrent.atomic.AtomicInteger;
-
 @RunWith(Parameterized.class)
 public class TestHttp1RequestReExecution extends AbstractIntegrationTestBase<CloseableHttpAsyncClient> {
 
@@ -131,23 +129,9 @@ public class TestHttp1RequestReExecution extends AbstractIntegrationTestBase<Clo
         };
 
         if (version.greaterEquals(HttpVersion.HTTP_2)) {
-            return super.start(null, new Decorator<AsyncServerExchangeHandler>() {
-
-                @Override
-                public AsyncServerExchangeHandler decorate(final AsyncServerExchangeHandler handler) {
-                    return new ServiceUnavailableAsyncDecorator(handler, serviceAvailabilityResolver);
-                }
-
-            }, H2Config.DEFAULT);
+            return super.start(null, handler -> new ServiceUnavailableAsyncDecorator(handler, serviceAvailabilityResolver), H2Config.DEFAULT);
         } else {
-            return super.start(null, new Decorator<AsyncServerExchangeHandler>() {
-
-                @Override
-                public AsyncServerExchangeHandler decorate(final AsyncServerExchangeHandler handler) {
-                    return new ServiceUnavailableAsyncDecorator(handler, serviceAvailabilityResolver);
-                }
-
-            }, Http1Config.DEFAULT);
+            return super.start(null, handler -> new ServiceUnavailableAsyncDecorator(handler, serviceAvailabilityResolver), Http1Config.DEFAULT);
         }
     }
 
diff --git a/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/sync/TestSPNegoScheme.java b/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/sync/TestSPNegoScheme.java
index cc039ee..6947d8f 100644
--- a/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/sync/TestSPNegoScheme.java
+++ b/httpclient5-testing/src/test/java/org/apache/hc/client5/testing/sync/TestSPNegoScheme.java
@@ -35,8 +35,8 @@ import org.apache.hc.client5.http.auth.AuthSchemeFactory;
 import org.apache.hc.client5.http.auth.AuthScope;
 import org.apache.hc.client5.http.auth.Credentials;
 import org.apache.hc.client5.http.auth.KerberosConfig;
-import org.apache.hc.client5.http.classic.methods.HttpGet;
 import org.apache.hc.client5.http.auth.StandardAuthScheme;
+import org.apache.hc.client5.http.classic.methods.HttpGet;
 import org.apache.hc.client5.http.impl.auth.BasicCredentialsProvider;
 import org.apache.hc.client5.http.impl.auth.SPNegoScheme;
 import org.apache.hc.client5.http.impl.classic.HttpClients;
@@ -53,10 +53,8 @@ import org.apache.hc.core5.http.io.entity.StringEntity;
 import org.apache.hc.core5.http.message.BasicHeader;
 import org.apache.hc.core5.http.protocol.HttpContext;
 import org.ietf.jgss.GSSContext;
-import org.ietf.jgss.GSSCredential;
 import org.ietf.jgss.GSSManager;
 import org.ietf.jgss.GSSName;
-import org.ietf.jgss.Oid;
 import org.junit.Assert;
 import org.junit.Test;
 import org.mockito.ArgumentMatchers;
@@ -98,14 +96,14 @@ public class TestSPNegoScheme extends LocalServerTestBase {
         NegotiateSchemeWithMockGssManager() throws Exception {
             super(KerberosConfig.DEFAULT, SystemDefaultDnsResolver.INSTANCE);
             Mockito.when(context.initSecContext(
-                    ArgumentMatchers.<byte[]>any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt()))
+                    ArgumentMatchers.any(), ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt()))
                     .thenReturn("12345678".getBytes());
             Mockito.when(manager.createName(
-                    ArgumentMatchers.anyString(), ArgumentMatchers.<Oid>any()))
+                    ArgumentMatchers.anyString(), ArgumentMatchers.any()))
                     .thenReturn(name);
             Mockito.when(manager.createContext(
-                    ArgumentMatchers.<GSSName>any(), ArgumentMatchers.<Oid>any(),
-                    ArgumentMatchers.<GSSCredential>any(), ArgumentMatchers.anyInt()))
+                    ArgumentMatchers.any(), ArgumentMatchers.any(),
+                    ArgumentMatchers.any(), ArgumentMatchers.anyInt()))
                     .thenReturn(context);
         }
 
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/HttpRoute.java b/httpclient5/src/main/java/org/apache/hc/client5/http/HttpRoute.java
index 6a57975..04592e1 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/HttpRoute.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/HttpRoute.java
@@ -141,8 +141,7 @@ public final class HttpRoute implements RouteInfo, Cloneable {
      *                  {@code false} otherwise
      */
     public HttpRoute(final HttpHost target, final InetAddress local, final boolean secure) {
-        this(target, local, Collections.<HttpHost>emptyList(), secure,
-                TunnelType.PLAIN, LayerType.PLAIN);
+        this(target, local, Collections.emptyList(), secure, TunnelType.PLAIN, LayerType.PLAIN);
     }
 
     /**
@@ -151,8 +150,7 @@ public final class HttpRoute implements RouteInfo, Cloneable {
      * @param target    the host to which to route
      */
     public HttpRoute(final HttpHost target) {
-        this(target, null, Collections.<HttpHost>emptyList(), false,
-                TunnelType.PLAIN, LayerType.PLAIN);
+        this(target, null, Collections.emptyList(), false, TunnelType.PLAIN, LayerType.PLAIN);
     }
 
     /**
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/MimeField.java b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/MimeField.java
index 3b2c681..87e9e96 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/MimeField.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/MimeField.java
@@ -58,7 +58,7 @@ public class MimeField {
         this.name = name;
         this.value = value;
         this.parameters = parameters != null ?
-                Collections.unmodifiableList(new ArrayList<>(parameters)) : Collections.<NameValuePair>emptyList();
+                Collections.unmodifiableList(new ArrayList<>(parameters)) : Collections.emptyList();
     }
 
     public MimeField(final MimeField from) {
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/MultipartEntityBuilder.java b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/MultipartEntityBuilder.java
index f506a71..06e4b21 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/MultipartEntityBuilder.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/MultipartEntityBuilder.java
@@ -229,7 +229,7 @@ public class MultipartEntityBuilder {
             }
         }
         final List<MultipartPart> multipartPartsCopy = multipartParts != null ? new ArrayList<>(multipartParts) :
-                Collections.<MultipartPart>emptyList();
+                Collections.emptyList();
         final HttpMultipartMode modeCopy = mode != null ? mode : HttpMultipartMode.STRICT;
         final AbstractMultipartFormat form;
         switch (modeCopy) {
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/cookie/RFC6265CookieSpec.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/cookie/RFC6265CookieSpec.java
index fb79434..8b2c08d 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/cookie/RFC6265CookieSpec.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/cookie/RFC6265CookieSpec.java
@@ -180,7 +180,7 @@ public class RFC6265CookieSpec implements CookieSpec {
             }
         }
 
-        return Collections.<Cookie>singletonList(cookie);
+        return Collections.singletonList(cookie);
     }
 
     @Override
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixList.java b/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixList.java
index 477b99d..8ba881a 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixList.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/psl/PublicSuffixList.java
@@ -56,7 +56,7 @@ public final class PublicSuffixList {
     public PublicSuffixList(final DomainType type, final List<String> rules, final List<String> exceptions) {
         this.type = Args.notNull(type, "Domain type");
         this.rules = Collections.unmodifiableList(Args.notNull(rules, "Domain suffix rules"));
-        this.exceptions = Collections.unmodifiableList(exceptions != null ? exceptions : Collections.<String>emptyList());
+        this.exceptions = Collections.unmodifiableList(exceptions != null ? exceptions : Collections.emptyList());
     }
 
     public PublicSuffixList(final List<String> rules, final List<String> exceptions) {
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestGZip.java b/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestGZip.java
index 7dca4c3..2dff33f 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestGZip.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/entity/TestGZip.java
@@ -71,7 +71,7 @@ public class TestGZip {
     @Test
     public void testCompressionIOExceptionLeavesOutputStreamOpen() throws Exception {
         final HttpEntity in = Mockito.mock(HttpEntity.class);
-        Mockito.doThrow(new IOException("Ooopsie")).when(in).writeTo(ArgumentMatchers.<OutputStream>any());
+        Mockito.doThrow(new IOException("Ooopsie")).when(in).writeTo(ArgumentMatchers.any());
         final GzipCompressingEntity gzipe = new GzipCompressingEntity(in);
         final OutputStream out = Mockito.mock(OutputStream.class);
         try {
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartForm.java b/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartForm.java
index ef63717..91910e0 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartForm.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartForm.java
@@ -65,7 +65,7 @@ public class TestMultipartForm {
                 "field3",
                 new StringBody("all kind of stuff", ContentType.DEFAULT_TEXT)).build();
         final HttpStrictMultipart multipart = new HttpStrictMultipart(null, "foo",
-                Arrays.<MultipartPart>asList(p1, p2, p3));
+                Arrays.asList(p1, p2, p3));
 
         final ByteArrayOutputStream out = new ByteArrayOutputStream();
         multipart.writeTo(out);
@@ -102,7 +102,7 @@ public class TestMultipartForm {
                 "field2",
                 new StringBody("that stuff", ContentType.parse("stuff/plain; param=value"))).build();
         final HttpStrictMultipart multipart = new HttpStrictMultipart(null, "foo",
-                Arrays.<MultipartPart>asList(p1, p2));
+                Arrays.asList(p1, p2));
 
         final ByteArrayOutputStream out = new ByteArrayOutputStream();
         multipart.writeTo(out);
@@ -140,7 +140,7 @@ public class TestMultipartForm {
                 "field2",
                 new InputStreamBody(new FileInputStream(tmpfile), "file.tmp")).build();
         final HttpStrictMultipart multipart = new HttpStrictMultipart(null, "foo",
-                Arrays.<MultipartPart>asList(p1, p2));
+                Arrays.asList(p1, p2));
 
         final ByteArrayOutputStream out = new ByteArrayOutputStream();
         multipart.writeTo(out);
@@ -183,7 +183,7 @@ public class TestMultipartForm {
                 "field3",
                 new InputStreamBody(new FileInputStream(tmpfile), "file.tmp")).build();
         final HttpStrictMultipart multipart = new HttpStrictMultipart(null, "foo",
-                Arrays.<MultipartPart>asList(p1, p2, p3));
+                Arrays.asList(p1, p2, p3));
 
         final ByteArrayOutputStream out = new ByteArrayOutputStream();
         multipart.writeTo(out);
@@ -232,7 +232,7 @@ public class TestMultipartForm {
                 "field3",
                 new InputStreamBody(new FileInputStream(tmpfile), "file.tmp")).build();
         final HttpRFC6532Multipart multipart = new HttpRFC6532Multipart(null, "foo",
-                Arrays.<MultipartPart>asList(p1, p2, p3));
+                Arrays.asList(p1, p2, p3));
 
         final ByteArrayOutputStream out = new ByteArrayOutputStream();
         multipart.writeTo(out);
@@ -302,7 +302,7 @@ public class TestMultipartForm {
                 new InputStreamBody(new FileInputStream(tmpfile), s2 + ".tmp")).build();
         final LegacyMultipart multipart = new LegacyMultipart(
                 StandardCharsets.UTF_8, "foo",
-                Arrays.<MultipartPart>asList(p1, p2));
+                Arrays.asList(p1, p2));
 
         final ByteArrayOutputStream out = new ByteArrayOutputStream();
         multipart.writeTo(out);
@@ -339,7 +339,7 @@ public class TestMultipartForm {
                 "field2",
                 new StringBody(s2, ContentType.create("text/plain", Charset.forName("KOI8-R")))).build();
         final HttpStrictMultipart multipart = new HttpStrictMultipart(null, "foo",
-                Arrays.<MultipartPart>asList(p1, p2));
+                Arrays.asList(p1, p2));
 
         final ByteArrayOutputStream out1 = new ByteArrayOutputStream();
         multipart.writeTo(out1);
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartMixed.java b/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartMixed.java
index 991757e..48ebf25 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartMixed.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/entity/mime/TestMultipartMixed.java
@@ -62,7 +62,7 @@ public class TestMultipartMixed {
         final MultipartPart p3 = MultipartPartBuilder.create(
                 new StringBody("all kind of stuff", ContentType.DEFAULT_TEXT)).build();
         final HttpStrictMultipart multipart = new HttpStrictMultipart(null, "foo",
-                Arrays.<MultipartPart>asList(p1, p2, p3));
+                Arrays.asList(p1, p2, p3));
 
         final ByteArrayOutputStream out = new ByteArrayOutputStream();
         multipart.writeTo(out);
@@ -94,7 +94,7 @@ public class TestMultipartMixed {
         final MultipartPart p2 = MultipartPartBuilder.create(
                 new StringBody("that stuff", ContentType.parse("stuff/plain; param=value"))).build();
         final HttpStrictMultipart multipart = new HttpStrictMultipart(null, "foo",
-                Arrays.<MultipartPart>asList(p1, p2));
+                Arrays.asList(p1, p2));
 
         final ByteArrayOutputStream out = new ByteArrayOutputStream();
         multipart.writeTo(out);
@@ -128,7 +128,7 @@ public class TestMultipartMixed {
         final MultipartPart p2 = MultipartPartBuilder.create(
                 new InputStreamBody(new FileInputStream(tmpfile), "file.tmp")).build();
         final HttpStrictMultipart multipart = new HttpStrictMultipart(null, "foo",
-                Arrays.<MultipartPart>asList(p1, p2));
+                Arrays.asList(p1, p2));
 
         final ByteArrayOutputStream out = new ByteArrayOutputStream();
         multipart.writeTo(out);
@@ -164,7 +164,7 @@ public class TestMultipartMixed {
         final MultipartPart p3 = MultipartPartBuilder.create(
                 new InputStreamBody(new FileInputStream(tmpfile), "file.tmp")).build();
         final HttpStrictMultipart multipart = new HttpStrictMultipart(null, "foo",
-                Arrays.<MultipartPart>asList(p1, p2, p3));
+                Arrays.asList(p1, p2, p3));
 
         final ByteArrayOutputStream out = new ByteArrayOutputStream();
         multipart.writeTo(out);
@@ -204,7 +204,7 @@ public class TestMultipartMixed {
         final MultipartPart p3 = MultipartPartBuilder.create(
                 new InputStreamBody(new FileInputStream(tmpfile), "file.tmp")).build();
         final HttpRFC6532Multipart multipart = new HttpRFC6532Multipart(null, "foo",
-                Arrays.<MultipartPart>asList(p1, p2, p3));
+                Arrays.asList(p1, p2, p3));
 
         final ByteArrayOutputStream out = new ByteArrayOutputStream();
         multipart.writeTo(out);
@@ -266,7 +266,7 @@ public class TestMultipartMixed {
                 new InputStreamBody(new FileInputStream(tmpfile), s2 + ".tmp")).build();
         final LegacyMultipart multipart = new LegacyMultipart(
                 StandardCharsets.UTF_8, "foo",
-                Arrays.<MultipartPart>asList(p1, p2));
+                Arrays.asList(p1, p2));
 
         final ByteArrayOutputStream out = new ByteArrayOutputStream();
         multipart.writeTo(out);
@@ -297,7 +297,7 @@ public class TestMultipartMixed {
         final MultipartPart p2 = MultipartPartBuilder.create(
                 new StringBody(s2, ContentType.create("text/plain", Charset.forName("KOI8-R")))).build();
         final HttpStrictMultipart multipart = new HttpStrictMultipart(null, "foo",
-                Arrays.<MultipartPart>asList(p1, p2));
+                Arrays.asList(p1, p2));
 
         final ByteArrayOutputStream out1 = new ByteArrayOutputStream();
         multipart.writeTo(out1);
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/TestAuthenticationStrategy.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/TestAuthenticationStrategy.java
index 8c5c45b..8df2029 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/TestAuthenticationStrategy.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/TestAuthenticationStrategy.java
@@ -37,8 +37,8 @@ import org.apache.hc.client5.http.auth.AuthScheme;
 import org.apache.hc.client5.http.auth.AuthSchemeFactory;
 import org.apache.hc.client5.http.auth.AuthScope;
 import org.apache.hc.client5.http.auth.ChallengeType;
-import org.apache.hc.client5.http.auth.UsernamePasswordCredentials;
 import org.apache.hc.client5.http.auth.StandardAuthScheme;
+import org.apache.hc.client5.http.auth.UsernamePasswordCredentials;
 import org.apache.hc.client5.http.config.RequestConfig;
 import org.apache.hc.client5.http.impl.auth.BasicCredentialsProvider;
 import org.apache.hc.client5.http.impl.auth.BasicScheme;
@@ -63,7 +63,7 @@ public class TestAuthenticationStrategy {
         final DefaultAuthenticationStrategy authStrategy = new DefaultAuthenticationStrategy();
         final HttpClientContext context = HttpClientContext.create();
         try {
-            authStrategy.select(null, Collections.<String, AuthChallenge>emptyMap(), context);
+            authStrategy.select(null, Collections.emptyMap(), context);
             Assert.fail("NullPointerException expected");
         } catch (final NullPointerException ex) {
         }
@@ -73,7 +73,7 @@ public class TestAuthenticationStrategy {
         } catch (final NullPointerException ex) {
         }
         try {
-            authStrategy.select(ChallengeType.TARGET, Collections.<String, AuthChallenge>emptyMap(), null);
+            authStrategy.select(ChallengeType.TARGET, Collections.emptyMap(), null);
             Assert.fail("NullPointerException expected");
         } catch (final NullPointerException ex) {
         }
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/TestIdleConnectionEvictor.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/TestIdleConnectionEvictor.java
index 061e89f..c23b2dc 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/TestIdleConnectionEvictor.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/TestIdleConnectionEvictor.java
@@ -69,7 +69,7 @@ public class TestIdleConnectionEvictor {
         Thread.sleep(1000);
 
         Mockito.verify(cm, Mockito.atLeast(1)).closeExpired();
-        Mockito.verify(cm, Mockito.never()).closeIdle(ArgumentMatchers.<TimeValue>any());
+        Mockito.verify(cm, Mockito.never()).closeIdle(ArgumentMatchers.any());
 
         Assert.assertTrue(connectionEvictor.isRunning());
 
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestHttpAuthenticator.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestHttpAuthenticator.java
index a6675c0..971ded0 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestHttpAuthenticator.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestHttpAuthenticator.java
@@ -39,8 +39,8 @@ import org.apache.hc.client5.http.auth.AuthenticationException;
 import org.apache.hc.client5.http.auth.ChallengeType;
 import org.apache.hc.client5.http.auth.Credentials;
 import org.apache.hc.client5.http.auth.CredentialsProvider;
-import org.apache.hc.client5.http.auth.UsernamePasswordCredentials;
 import org.apache.hc.client5.http.auth.StandardAuthScheme;
+import org.apache.hc.client5.http.auth.UsernamePasswordCredentials;
 import org.apache.hc.client5.http.impl.DefaultAuthenticationStrategy;
 import org.apache.hc.client5.http.protocol.HttpClientContext;
 import org.apache.hc.core5.http.HttpHeaders;
@@ -170,8 +170,8 @@ public class TestHttpAuthenticator {
         response.addHeader(new BasicHeader(HttpHeaders.WWW_AUTHENTICATE, "whatever realm=\"realm1\", stuff=\"1234\""));
 
         final Credentials credentials = new UsernamePasswordCredentials("user", "pass".toCharArray());
-        Mockito.when(this.credentialsProvider.getCredentials(Mockito.<AuthScope>any(),
-                                                             Mockito.<HttpContext>any())).thenReturn(credentials);
+        Mockito.when(this.credentialsProvider.getCredentials(Mockito.any(),
+                                                             Mockito.any())).thenReturn(credentials);
 
         final DefaultAuthenticationStrategy authStrategy = new DefaultAuthenticationStrategy();
 
@@ -200,7 +200,7 @@ public class TestHttpAuthenticator {
 
         final Credentials credentials = new UsernamePasswordCredentials("user", "pass".toCharArray());
         Mockito.when(this.credentialsProvider.getCredentials(Mockito.eq(new AuthScope(host, "test", StandardAuthScheme.BASIC)),
-                                                             Mockito.<HttpContext>any())).thenReturn(credentials);
+                                                             Mockito.any())).thenReturn(credentials);
 
         final DefaultAuthenticationStrategy authStrategy = new DefaultAuthenticationStrategy();
 
@@ -336,7 +336,7 @@ public class TestHttpAuthenticator {
 
         final Credentials credentials = new UsernamePasswordCredentials("user", "pass".toCharArray());
         Mockito.when(this.credentialsProvider.getCredentials(Mockito.eq(new AuthScope(host, "realm1", StandardAuthScheme.DIGEST)),
-                                                             Mockito.<HttpContext>any())).thenReturn(credentials);
+                                                             Mockito.any())).thenReturn(credentials);
 
         final DefaultAuthenticationStrategy authStrategy = new DefaultAuthenticationStrategy();
 
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestSystemDefaultCredentialsProvider.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestSystemDefaultCredentialsProvider.java
index 416b5ee..cb33caf 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestSystemDefaultCredentialsProvider.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/auth/TestSystemDefaultCredentialsProvider.java
@@ -32,9 +32,9 @@ import java.net.InetAddress;
 import java.net.PasswordAuthentication;
 import java.net.URL;
 
-import org.apache.hc.client5.http.auth.StandardAuthScheme;
 import org.apache.hc.client5.http.auth.AuthScope;
 import org.apache.hc.client5.http.auth.Credentials;
+import org.apache.hc.client5.http.auth.StandardAuthScheme;
 import org.apache.hc.client5.http.classic.methods.HttpGet;
 import org.apache.hc.core5.http.protocol.HttpCoreContext;
 import org.junit.Assert;
@@ -128,10 +128,10 @@ public class TestSystemDefaultCredentialsProvider {
     private AuthenticatorDelegate installAuthenticator(final PasswordAuthentication returedAuthentication) {
         final AuthenticatorDelegate authenticatorDelegate = Mockito.mock(AuthenticatorDelegate.class);
         Mockito.when(authenticatorDelegate.getPasswordAuthentication(ArgumentMatchers.anyString(),
-                                                                     ArgumentMatchers.<InetAddress>any(), ArgumentMatchers.anyInt(),
+                                                                     ArgumentMatchers.any(), ArgumentMatchers.anyInt(),
                                                                      ArgumentMatchers.anyString(), ArgumentMatchers.anyString(),
-                                                                     ArgumentMatchers.anyString(), ArgumentMatchers.<URL>any(),
-                                                                     ArgumentMatchers.<RequestorType>any())).thenReturn(returedAuthentication);
+                                                                     ArgumentMatchers.anyString(), ArgumentMatchers.any(),
+                                                                     ArgumentMatchers.any())).thenReturn(returedAuthentication);
         Authenticator.setDefault(new DelegatedAuthenticator(authenticatorDelegate));
         return authenticatorDelegate;
     }
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestConnectExec.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestConnectExec.java
index a2bdc7c..0505aa8 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestConnectExec.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestConnectExec.java
@@ -29,13 +29,10 @@ package org.apache.hc.client5.http.impl.classic;
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
 import java.util.Collections;
-import java.util.Map;
 
 import org.apache.hc.client5.http.AuthenticationStrategy;
 import org.apache.hc.client5.http.HttpRoute;
 import org.apache.hc.client5.http.RouteInfo;
-import org.apache.hc.client5.http.auth.AuthChallenge;
-import org.apache.hc.client5.http.auth.AuthScheme;
 import org.apache.hc.client5.http.auth.AuthScope;
 import org.apache.hc.client5.http.auth.ChallengeType;
 import org.apache.hc.client5.http.auth.StandardAuthScheme;
@@ -55,7 +52,6 @@ import org.apache.hc.core5.http.HttpException;
 import org.apache.hc.core5.http.HttpHeaders;
 import org.apache.hc.core5.http.HttpHost;
 import org.apache.hc.core5.http.HttpRequest;
-import org.apache.hc.core5.http.HttpResponse;
 import org.apache.hc.core5.http.HttpVersion;
 import org.apache.hc.core5.http.io.entity.StringEntity;
 import org.apache.hc.core5.http.message.BasicClassicHttpResponse;
@@ -121,7 +117,7 @@ public class TestConnectExec {
         final ClassicHttpRequest request = new HttpGet("http://bar/test");
 
         final ConnectionState connectionState = new ConnectionState();
-        Mockito.doAnswer(connectionState.connectAnswer()).when(execRuntime).connectEndpoint(Mockito.<HttpClientContext>any());
+        Mockito.doAnswer(connectionState.connectAnswer()).when(execRuntime).connectEndpoint(Mockito.any());
         Mockito.when(execRuntime.isEndpointConnected()).thenAnswer(connectionState.isConnectedAnswer());
 
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, execRuntime, context);
@@ -130,8 +126,8 @@ public class TestConnectExec {
         Mockito.verify(execRuntime).connectEndpoint(context);
         Mockito.verify(execRuntime, Mockito.never()).execute(
                 Mockito.anyString(),
-                Mockito.<ClassicHttpRequest>any(),
-                Mockito.<HttpClientContext>any());
+                Mockito.any(),
+                Mockito.any());
     }
 
     @Test
@@ -141,7 +137,7 @@ public class TestConnectExec {
         final ClassicHttpRequest request = new HttpGet("http://bar/test");
 
         final ConnectionState connectionState = new ConnectionState();
-        Mockito.doAnswer(connectionState.connectAnswer()).when(execRuntime).connectEndpoint(Mockito.<HttpClientContext>any());
+        Mockito.doAnswer(connectionState.connectAnswer()).when(execRuntime).connectEndpoint(Mockito.any());
         Mockito.when(execRuntime.isEndpointConnected()).thenAnswer(connectionState.isConnectedAnswer());
 
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, execRuntime, context);
@@ -150,8 +146,8 @@ public class TestConnectExec {
         Mockito.verify(execRuntime).connectEndpoint(context);
         Mockito.verify(execRuntime, Mockito.never()).execute(
                 Mockito.anyString(),
-                Mockito.<ClassicHttpRequest>any(),
-                Mockito.<HttpClientContext>any());
+                Mockito.any(),
+                Mockito.any());
     }
 
     @Test
@@ -162,12 +158,12 @@ public class TestConnectExec {
         final ClassicHttpResponse response = new BasicClassicHttpResponse(200, "OK");
 
         final ConnectionState connectionState = new ConnectionState();
-        Mockito.doAnswer(connectionState.connectAnswer()).when(execRuntime).connectEndpoint(Mockito.<HttpClientContext>any());
+        Mockito.doAnswer(connectionState.connectAnswer()).when(execRuntime).connectEndpoint(Mockito.any());
         Mockito.when(execRuntime.isEndpointConnected()).thenAnswer(connectionState.isConnectedAnswer());
         Mockito.when(execRuntime.execute(
                 Mockito.anyString(),
-                Mockito.<ClassicHttpRequest>any(),
-                Mockito.<HttpClientContext>any())).thenReturn(response);
+                Mockito.any(),
+                Mockito.any())).thenReturn(response);
 
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, execRuntime, context);
         exec.execute(request, scope, execChain);
@@ -193,12 +189,12 @@ public class TestConnectExec {
         final ClassicHttpResponse response = new BasicClassicHttpResponse(101, "Lost");
 
         final ConnectionState connectionState = new ConnectionState();
-        Mockito.doAnswer(connectionState.connectAnswer()).when(execRuntime).connectEndpoint(Mockito.<HttpClientContext>any());
+        Mockito.doAnswer(connectionState.connectAnswer()).when(execRuntime).connectEndpoint(Mockito.any());
         Mockito.when(execRuntime.isEndpointConnected()).thenAnswer(connectionState.isConnectedAnswer());
         Mockito.when(execRuntime.execute(
                 Mockito.anyString(),
-                Mockito.<ClassicHttpRequest>any(),
-                Mockito.<HttpClientContext>any())).thenReturn(response);
+                Mockito.any(),
+                Mockito.any())).thenReturn(response);
 
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, execRuntime, context);
         exec.execute(request, scope, execChain);
@@ -213,12 +209,12 @@ public class TestConnectExec {
         response.setEntity(new StringEntity("Ka-boom"));
 
         final ConnectionState connectionState = new ConnectionState();
-        Mockito.doAnswer(connectionState.connectAnswer()).when(execRuntime).connectEndpoint(Mockito.<HttpClientContext>any());
+        Mockito.doAnswer(connectionState.connectAnswer()).when(execRuntime).connectEndpoint(Mockito.any());
         Mockito.when(execRuntime.isEndpointConnected()).thenAnswer(connectionState.isConnectedAnswer());
         Mockito.when(execRuntime.execute(
                 Mockito.anyString(),
-                Mockito.<ClassicHttpRequest>any(),
-                Mockito.<HttpClientContext>any())).thenReturn(response);
+                Mockito.any(),
+                Mockito.any())).thenReturn(response);
 
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, execRuntime, context);
         try {
@@ -249,21 +245,21 @@ public class TestConnectExec {
         context.setCredentialsProvider(credentialsProvider);
 
         final ConnectionState connectionState = new ConnectionState();
-        Mockito.doAnswer(connectionState.connectAnswer()).when(execRuntime).connectEndpoint(Mockito.<HttpClientContext>any());
+        Mockito.doAnswer(connectionState.connectAnswer()).when(execRuntime).connectEndpoint(Mockito.any());
         Mockito.when(execRuntime.isEndpointConnected()).thenAnswer(connectionState.isConnectedAnswer());
         Mockito.when(reuseStrategy.keepAlive(
                 Mockito.same(request),
-                Mockito.<HttpResponse>any(),
+                Mockito.any(),
                 Mockito.<HttpClientContext>any())).thenReturn(Boolean.TRUE);
         Mockito.when(execRuntime.execute(
                 Mockito.anyString(),
-                Mockito.<ClassicHttpRequest>any(),
-                Mockito.<HttpClientContext>any())).thenReturn(response1, response2);
+                Mockito.any(),
+                Mockito.any())).thenReturn(response1, response2);
 
         Mockito.when(proxyAuthStrategy.select(
                 Mockito.eq(ChallengeType.PROXY),
-                Mockito.<Map<String, AuthChallenge>>any(),
-                Mockito.<HttpClientContext>any())).thenReturn(Collections.<AuthScheme>singletonList(new BasicScheme()));
+                Mockito.any(),
+                Mockito.<HttpClientContext>any())).thenReturn(Collections.singletonList(new BasicScheme()));
 
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, execRuntime, context);
         exec.execute(request, scope, execChain);
@@ -290,21 +286,21 @@ public class TestConnectExec {
         context.setCredentialsProvider(credentialsProvider);
 
         final ConnectionState connectionState = new ConnectionState();
-        Mockito.doAnswer(connectionState.connectAnswer()).when(execRuntime).connectEndpoint(Mockito.<HttpClientContext>any());
+        Mockito.doAnswer(connectionState.connectAnswer()).when(execRuntime).connectEndpoint(Mockito.any());
         Mockito.when(execRuntime.isEndpointConnected()).thenAnswer(connectionState.isConnectedAnswer());
         Mockito.when(reuseStrategy.keepAlive(
                 Mockito.same(request),
-                Mockito.<HttpResponse>any(),
+                Mockito.any(),
                 Mockito.<HttpClientContext>any())).thenReturn(Boolean.FALSE);
         Mockito.when(execRuntime.execute(
                 Mockito.anyString(),
-                Mockito.<ClassicHttpRequest>any(),
-                Mockito.<HttpClientContext>any())).thenReturn(response1, response2);
+                Mockito.any(),
+                Mockito.any())).thenReturn(response1, response2);
 
         Mockito.when(proxyAuthStrategy.select(
                 Mockito.eq(ChallengeType.PROXY),
-                Mockito.<Map<String, AuthChallenge>>any(),
-                Mockito.<HttpClientContext>any())).thenReturn(Collections.<AuthScheme>singletonList(new BasicScheme()));
+                Mockito.any(),
+                Mockito.<HttpClientContext>any())).thenReturn(Collections.singletonList(new BasicScheme()));
 
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, execRuntime, context);
         exec.execute(request, scope, execChain);
@@ -324,7 +320,7 @@ public class TestConnectExec {
         final ClassicHttpRequest request = new HttpGet("http://bar/test");
 
         final ConnectionState connectionState = new ConnectionState();
-        Mockito.doAnswer(connectionState.connectAnswer()).when(execRuntime).connectEndpoint(Mockito.<HttpClientContext>any());
+        Mockito.doAnswer(connectionState.connectAnswer()).when(execRuntime).connectEndpoint(Mockito.any());
         Mockito.when(execRuntime.isEndpointConnected()).thenAnswer(connectionState.isConnectedAnswer());
 
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, execRuntime, context);
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestHttpRequestRetryExec.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestHttpRequestRetryExec.java
index 32c6542..805a341 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestHttpRequestRetryExec.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestHttpRequestRetryExec.java
@@ -43,10 +43,7 @@ import org.apache.hc.core5.http.ClassicHttpRequest;
 import org.apache.hc.core5.http.ClassicHttpResponse;
 import org.apache.hc.core5.http.Header;
 import org.apache.hc.core5.http.HttpHost;
-import org.apache.hc.core5.http.HttpRequest;
-import org.apache.hc.core5.http.HttpResponse;
 import org.apache.hc.core5.http.io.support.ClassicRequestBuilder;
-import org.apache.hc.core5.http.protocol.HttpContext;
 import org.apache.hc.core5.util.TimeValue;
 import org.apache.hc.core5.util.Timeout;
 import org.junit.Assert;
@@ -88,21 +85,21 @@ public class TestHttpRequestRetryExec {
 
         Mockito.when(chain.proceed(
                 Mockito.same(request),
-                Mockito.<ExecChain.Scope>any())).thenReturn(response);
+                Mockito.any())).thenReturn(response);
         Mockito.when(retryStrategy.retryRequest(
-                Mockito.<HttpResponse>any(),
+                Mockito.any(),
                 Mockito.anyInt(),
-                Mockito.<HttpContext>any())).thenReturn(Boolean.TRUE, Boolean.FALSE);
+                Mockito.any())).thenReturn(Boolean.TRUE, Boolean.FALSE);
         Mockito.when(retryStrategy.getRetryInterval(
-                Mockito.<HttpResponse>any(),
+                Mockito.any(),
                 Mockito.anyInt(),
-                Mockito.<HttpContext>any())).thenReturn(TimeValue.ZERO_MILLISECONDS);
+                Mockito.any())).thenReturn(TimeValue.ZERO_MILLISECONDS);
 
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, endpoint, context);
         retryExec.execute(request, scope, chain);
 
         Mockito.verify(chain, Mockito.times(2)).proceed(
-                Mockito.<ClassicHttpRequest>any(),
+                Mockito.any(),
                 Mockito.same(scope));
         Mockito.verify(response, Mockito.times(1)).close();
     }
@@ -120,21 +117,21 @@ public class TestHttpRequestRetryExec {
 
         Mockito.when(chain.proceed(
                 Mockito.same(request),
-                Mockito.<ExecChain.Scope>any())).thenReturn(response);
+                Mockito.any())).thenReturn(response);
         Mockito.when(retryStrategy.retryRequest(
-                Mockito.<HttpResponse>any(),
+                Mockito.any(),
                 Mockito.anyInt(),
-                Mockito.<HttpContext>any())).thenReturn(Boolean.TRUE, Boolean.FALSE);
+                Mockito.any())).thenReturn(Boolean.TRUE, Boolean.FALSE);
         Mockito.when(retryStrategy.getRetryInterval(
-                Mockito.<HttpResponse>any(),
+                Mockito.any(),
                 Mockito.anyInt(),
-                Mockito.<HttpContext>any())).thenReturn(TimeValue.ofSeconds(5));
+                Mockito.any())).thenReturn(TimeValue.ofSeconds(5));
 
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, endpoint, context);
         retryExec.execute(request, scope, chain);
 
         Mockito.verify(chain, Mockito.times(1)).proceed(
-                Mockito.<ClassicHttpRequest>any(),
+                Mockito.any(),
                 Mockito.same(scope));
         Mockito.verify(response, Mockito.times(0)).close();
     }
@@ -152,21 +149,21 @@ public class TestHttpRequestRetryExec {
 
         Mockito.when(chain.proceed(
                 Mockito.same(request),
-                Mockito.<ExecChain.Scope>any())).thenReturn(response);
+                Mockito.any())).thenReturn(response);
         Mockito.when(retryStrategy.retryRequest(
-                Mockito.<HttpResponse>any(),
+                Mockito.any(),
                 Mockito.anyInt(),
-                Mockito.<HttpContext>any())).thenReturn(Boolean.TRUE, Boolean.FALSE);
+                Mockito.any())).thenReturn(Boolean.TRUE, Boolean.FALSE);
         Mockito.when(retryStrategy.getRetryInterval(
-                Mockito.<HttpResponse>any(),
+                Mockito.any(),
                 Mockito.anyInt(),
-                Mockito.<HttpContext>any())).thenReturn(TimeValue.ofSeconds(1));
+                Mockito.any())).thenReturn(TimeValue.ofSeconds(1));
 
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, endpoint, context);
         retryExec.execute(request, scope, chain);
 
         Mockito.verify(chain, Mockito.times(2)).proceed(
-                Mockito.<ClassicHttpRequest>any(),
+                Mockito.any(),
                 Mockito.same(scope));
         Mockito.verify(response, Mockito.times(1)).close();
     }
@@ -179,12 +176,12 @@ public class TestHttpRequestRetryExec {
 
         final ClassicHttpResponse response = Mockito.mock(ClassicHttpResponse.class);
         Mockito.when(chain.proceed(
-                Mockito.<ClassicHttpRequest>any(),
-                Mockito.<ExecChain.Scope>any())).thenReturn(response);
+                Mockito.any(),
+                Mockito.any())).thenReturn(response);
         Mockito.doThrow(new RuntimeException("Ooopsie")).when(retryStrategy).retryRequest(
-                Mockito.<HttpResponse>any(),
+                Mockito.any(),
                 Mockito.anyInt(),
-                Mockito.<HttpContext>any());
+                Mockito.any());
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, endpoint, context);
         try {
             retryExec.execute(request, scope, chain);
@@ -206,8 +203,8 @@ public class TestHttpRequestRetryExec {
 
         final ClassicHttpResponse response = Mockito.mock(ClassicHttpResponse.class);
         Mockito.when(chain.proceed(
-                Mockito.<ClassicHttpRequest>any(),
-                Mockito.<ExecChain.Scope>any())).thenReturn(response);
+                Mockito.any(),
+                Mockito.any())).thenReturn(response);
 
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, endpoint, context);
         final ClassicHttpResponse finalResponse = retryExec.execute(request, scope, chain);
@@ -225,8 +222,8 @@ public class TestHttpRequestRetryExec {
         final HttpClientContext context = HttpClientContext.create();
 
         Mockito.when(chain.proceed(
-                Mockito.<ClassicHttpRequest>any(),
-                Mockito.<ExecChain.Scope>any())).thenAnswer(invocationOnMock -> {
+                Mockito.any(),
+                Mockito.any())).thenAnswer(invocationOnMock -> {
                     final Object[] args = invocationOnMock.getArguments();
                     final ClassicHttpRequest wrapper = (ClassicHttpRequest) args[0];
                     final Header[] headers = wrapper.getHeaders();
@@ -237,17 +234,17 @@ public class TestHttpRequestRetryExec {
                     throw new IOException("Ka-boom");
                 });
         Mockito.when(retryStrategy.retryRequest(
-                Mockito.<HttpRequest>any(),
-                Mockito.<IOException>any(),
+                Mockito.any(),
+                Mockito.any(),
                 Mockito.eq(1),
-                Mockito.<HttpContext>any())).thenReturn(Boolean.TRUE);
+                Mockito.any())).thenReturn(Boolean.TRUE);
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, originalRequest, endpoint, context);
         final ClassicHttpRequest request = ClassicRequestBuilder.copy(originalRequest).build();
         try {
             retryExec.execute(request, scope, chain);
         } catch (final IOException ex) {
             Mockito.verify(chain, Mockito.times(2)).proceed(
-                    Mockito.<ClassicHttpRequest>any(),
+                    Mockito.any(),
                     Mockito.same(scope));
             throw ex;
         }
@@ -261,8 +258,8 @@ public class TestHttpRequestRetryExec {
         final HttpClientContext context = HttpClientContext.create();
 
         Mockito.when(chain.proceed(
-                Mockito.<ClassicHttpRequest>any(),
-                Mockito.<ExecChain.Scope>any())).thenThrow(new IOException("Ka-boom"));
+                Mockito.any(),
+                Mockito.any())).thenThrow(new IOException("Ka-boom"));
         Mockito.when(endpoint.isExecutionAborted()).thenReturn(true);
 
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, originalRequest, endpoint, context);
@@ -274,10 +271,10 @@ public class TestHttpRequestRetryExec {
                     Mockito.same(request),
                     Mockito.same(scope));
             Mockito.verify(retryStrategy, Mockito.never()).retryRequest(
-                    Mockito.<HttpRequest>any(),
-                    Mockito.<IOException>any(),
+                    Mockito.any(),
+                    Mockito.any(),
                     Mockito.anyInt(),
-                    Mockito.<HttpContext>any());
+                    Mockito.any());
 
             throw ex;
         }
@@ -293,8 +290,8 @@ public class TestHttpRequestRetryExec {
         final HttpClientContext context = HttpClientContext.create();
 
         Mockito.when(chain.proceed(
-                Mockito.<ClassicHttpRequest>any(),
-                Mockito.<ExecChain.Scope>any())).thenAnswer(invocationOnMock -> {
+                Mockito.any(),
+                Mockito.any())).thenAnswer(invocationOnMock -> {
                     final Object[] args = invocationOnMock.getArguments();
                     final ClassicHttpRequest req = (ClassicHttpRequest) args[0];
                     req.getEntity().writeTo(new ByteArrayOutputStream());
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestInternalExecRuntime.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestInternalExecRuntime.java
index a7ec7f6..dc2483b 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestInternalExecRuntime.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestInternalExecRuntime.java
@@ -36,7 +36,6 @@ import org.apache.hc.client5.http.io.ConnectionEndpoint;
 import org.apache.hc.client5.http.io.HttpClientConnectionManager;
 import org.apache.hc.client5.http.io.LeaseRequest;
 import org.apache.hc.client5.http.protocol.HttpClientContext;
-import org.apache.hc.core5.concurrent.Cancellable;
 import org.apache.hc.core5.concurrent.CancellableDependency;
 import org.apache.hc.core5.http.ConnectionRequestTimeoutException;
 import org.apache.hc.core5.http.HttpHost;
@@ -89,9 +88,9 @@ public class TestInternalExecRuntime {
         context.setRequestConfig(config);
         final HttpRoute route = new HttpRoute(new HttpHost("host", 80));
 
-        Mockito.when(mgr.lease(Mockito.eq("some-id"), Mockito.eq(route), Mockito.<Timeout>any(), Mockito.any()))
+        Mockito.when(mgr.lease(Mockito.eq("some-id"), Mockito.eq(route), Mockito.any(), Mockito.any()))
                 .thenReturn(leaseRequest);
-        Mockito.when(leaseRequest.get(Mockito.<Timeout>any())).thenReturn(connectionEndpoint);
+        Mockito.when(leaseRequest.get(Mockito.any())).thenReturn(connectionEndpoint);
 
         execRuntime.acquireEndpoint("some-id", route, null, context);
 
@@ -103,16 +102,16 @@ public class TestInternalExecRuntime {
         Mockito.verify(leaseRequest).get(Timeout.ofMilliseconds(345));
         Mockito.verify(cancellableDependency, Mockito.times(1)).setDependency(leaseRequest);
         Mockito.verify(cancellableDependency, Mockito.times(1)).setDependency(execRuntime);
-        Mockito.verify(cancellableDependency, Mockito.times(2)).setDependency(Mockito.<Cancellable>any());
+        Mockito.verify(cancellableDependency, Mockito.times(2)).setDependency(Mockito.any());
     }
 
     @Test(expected = IllegalStateException.class)
     public void testAcquireEndpointAlreadyAcquired() throws Exception {
         final HttpClientContext context = HttpClientContext.create();
 
-        Mockito.when(mgr.lease(Mockito.eq("some-id"), Mockito.eq(route), Mockito.<Timeout>any(), Mockito.any()))
+        Mockito.when(mgr.lease(Mockito.eq("some-id"), Mockito.eq(route), Mockito.any(), Mockito.any()))
                 .thenReturn(leaseRequest);
-        Mockito.when(leaseRequest.get(Mockito.<Timeout>any())).thenReturn(connectionEndpoint);
+        Mockito.when(leaseRequest.get(Mockito.any())).thenReturn(connectionEndpoint);
 
         execRuntime.acquireEndpoint("some-id", route, null, context);
 
@@ -126,9 +125,9 @@ public class TestInternalExecRuntime {
     public void testAcquireEndpointLeaseRequestTimeout() throws Exception {
         final HttpClientContext context = HttpClientContext.create();
 
-        Mockito.when(mgr.lease(Mockito.eq("some-id"), Mockito.eq(route), Mockito.<Timeout>any(), Mockito.any()))
+        Mockito.when(mgr.lease(Mockito.eq("some-id"), Mockito.eq(route), Mockito.any(), Mockito.any()))
                 .thenReturn(leaseRequest);
-        Mockito.when(leaseRequest.get(Mockito.<Timeout>any())).thenThrow(new TimeoutException("timeout"));
+        Mockito.when(leaseRequest.get(Mockito.any())).thenThrow(new TimeoutException("timeout"));
 
         execRuntime.acquireEndpoint("some-id", route, null, context);
     }
@@ -137,9 +136,9 @@ public class TestInternalExecRuntime {
     public void testAcquireEndpointLeaseRequestFailure() throws Exception {
         final HttpClientContext context = HttpClientContext.create();
 
-        Mockito.when(mgr.lease(Mockito.eq("some-id"), Mockito.eq(route), Mockito.<Timeout>any(), Mockito.any()))
+        Mockito.when(mgr.lease(Mockito.eq("some-id"), Mockito.eq(route), Mockito.any(), Mockito.any()))
                 .thenReturn(leaseRequest);
-        Mockito.when(leaseRequest.get(Mockito.<Timeout>any())).thenThrow(new ExecutionException(new IllegalStateException()));
+        Mockito.when(leaseRequest.get(Mockito.any())).thenThrow(new ExecutionException(new IllegalStateException()));
 
         execRuntime.acquireEndpoint("some-id", route, null, context);
     }
@@ -147,9 +146,9 @@ public class TestInternalExecRuntime {
     @Test
     public void testAbortEndpoint() throws Exception {
         final HttpClientContext context = HttpClientContext.create();
-        Mockito.when(mgr.lease(Mockito.eq("some-id"), Mockito.eq(route), Mockito.<Timeout>any(), Mockito.any()))
+        Mockito.when(mgr.lease(Mockito.eq("some-id"), Mockito.eq(route), Mockito.any(), Mockito.any()))
                 .thenReturn(leaseRequest);
-        Mockito.when(leaseRequest.get(Mockito.<Timeout>any())).thenReturn(connectionEndpoint);
+        Mockito.when(leaseRequest.get(Mockito.any())).thenReturn(connectionEndpoint);
 
         execRuntime.acquireEndpoint("some-id", new HttpRoute(new HttpHost("host", 80)), null, context);
         Assert.assertTrue(execRuntime.isEndpointAcquired());
@@ -164,18 +163,18 @@ public class TestInternalExecRuntime {
 
         Mockito.verify(connectionEndpoint, Mockito.times(1)).close(CloseMode.IMMEDIATE);
         Mockito.verify(mgr, Mockito.times(1)).release(
-                Mockito.<ConnectionEndpoint>any(),
                 Mockito.any(),
-                Mockito.<TimeValue>any());
+                Mockito.any(),
+                Mockito.any());
     }
 
     @Test
     public void testCancell() throws Exception {
         final HttpClientContext context = HttpClientContext.create();
 
-        Mockito.when(mgr.lease(Mockito.eq("some-id"), Mockito.eq(route), Mockito.<Timeout>any(), Mockito.any()))
+        Mockito.when(mgr.lease(Mockito.eq("some-id"), Mockito.eq(route), Mockito.any(), Mockito.any()))
                 .thenReturn(leaseRequest);
-        Mockito.when(leaseRequest.get(Mockito.<Timeout>any())).thenReturn(connectionEndpoint);
+        Mockito.when(leaseRequest.get(Mockito.any())).thenReturn(connectionEndpoint);
 
         execRuntime.acquireEndpoint("some-id", route, null, context);
         Assert.assertTrue(execRuntime.isEndpointAcquired());
@@ -191,18 +190,18 @@ public class TestInternalExecRuntime {
 
         Mockito.verify(connectionEndpoint, Mockito.times(1)).close(CloseMode.IMMEDIATE);
         Mockito.verify(mgr, Mockito.times(1)).release(
-                Mockito.<ConnectionEndpoint>any(),
                 Mockito.any(),
-                Mockito.<TimeValue>any());
+                Mockito.any(),
+                Mockito.any());
     }
 
     @Test
     public void testReleaseEndpointReusable() throws Exception {
         final HttpClientContext context = HttpClientContext.create();
 
-        Mockito.when(mgr.lease(Mockito.eq("some-id"), Mockito.eq(route), Mockito.<Timeout>any(), Mockito.any()))
+        Mockito.when(mgr.lease(Mockito.eq("some-id"), Mockito.eq(route), Mockito.any(), Mockito.any()))
                 .thenReturn(leaseRequest);
-        Mockito.when(leaseRequest.get(Mockito.<Timeout>any())).thenReturn(connectionEndpoint);
+        Mockito.when(leaseRequest.get(Mockito.any())).thenReturn(connectionEndpoint);
 
         execRuntime.acquireEndpoint("some-id", route, null, context);
         Assert.assertTrue(execRuntime.isEndpointAcquired());
@@ -219,18 +218,18 @@ public class TestInternalExecRuntime {
         execRuntime.releaseEndpoint();
 
         Mockito.verify(mgr, Mockito.times(1)).release(
-                Mockito.<ConnectionEndpoint>any(),
                 Mockito.any(),
-                Mockito.<TimeValue>any());
+                Mockito.any(),
+                Mockito.any());
     }
 
     @Test
     public void testReleaseEndpointNonReusable() throws Exception {
         final HttpClientContext context = HttpClientContext.create();
 
-        Mockito.when(mgr.lease(Mockito.eq("some-id"), Mockito.eq(route), Mockito.<Timeout>any(), Mockito.any()))
+        Mockito.when(mgr.lease(Mockito.eq("some-id"), Mockito.eq(route), Mockito.any(), Mockito.any()))
                 .thenReturn(leaseRequest);
-        Mockito.when(leaseRequest.get(Mockito.<Timeout>any())).thenReturn(connectionEndpoint);
+        Mockito.when(leaseRequest.get(Mockito.any())).thenReturn(connectionEndpoint);
 
         execRuntime.acquireEndpoint("some-id", route, null, context);
         Assert.assertTrue(execRuntime.isEndpointAcquired());
@@ -248,9 +247,9 @@ public class TestInternalExecRuntime {
         execRuntime.releaseEndpoint();
 
         Mockito.verify(mgr, Mockito.times(1)).release(
-                Mockito.<ConnectionEndpoint>any(),
                 Mockito.any(),
-                Mockito.<TimeValue>any());
+                Mockito.any(),
+                Mockito.any());
     }
 
     @Test
@@ -262,9 +261,9 @@ public class TestInternalExecRuntime {
                 .build();
         context.setRequestConfig(config);
 
-        Mockito.when(mgr.lease(Mockito.eq("some-id"), Mockito.eq(route), Mockito.<Timeout>any(), Mockito.any()))
+        Mockito.when(mgr.lease(Mockito.eq("some-id"), Mockito.eq(route), Mockito.any(), Mockito.any()))
                 .thenReturn(leaseRequest);
-        Mockito.when(leaseRequest.get(Mockito.<Timeout>any())).thenReturn(connectionEndpoint);
+        Mockito.when(leaseRequest.get(Mockito.any())).thenReturn(connectionEndpoint);
 
         execRuntime.acquireEndpoint("some-id", route, null, context);
         Assert.assertTrue(execRuntime.isEndpointAcquired());
@@ -281,9 +280,9 @@ public class TestInternalExecRuntime {
     public void testDisonnectEndpoint() throws Exception {
         final HttpClientContext context = HttpClientContext.create();
 
-        Mockito.when(mgr.lease(Mockito.eq("some-id"), Mockito.eq(route), Mockito.<Timeout>any(), Mockito.any()))
+        Mockito.when(mgr.lease(Mockito.eq("some-id"), Mockito.eq(route), Mockito.any(), Mockito.any()))
                 .thenReturn(leaseRequest);
-        Mockito.when(leaseRequest.get(Mockito.<Timeout>any())).thenReturn(connectionEndpoint);
+        Mockito.when(leaseRequest.get(Mockito.any())).thenReturn(connectionEndpoint);
 
         execRuntime.acquireEndpoint("some-id", route, null, context);
         Assert.assertTrue(execRuntime.isEndpointAcquired());
@@ -294,7 +293,7 @@ public class TestInternalExecRuntime {
         execRuntime.connectEndpoint(context);
 
         Mockito.verify(mgr, Mockito.never()).connect(
-                Mockito.same(connectionEndpoint), Mockito.<TimeValue>any(), Mockito.<HttpClientContext>any());
+                Mockito.same(connectionEndpoint), Mockito.any(), Mockito.<HttpClientContext>any());
 
         execRuntime.disconnectEndpoint();
 
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestInternalHttpClient.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestInternalHttpClient.java
index b67fea1..fc09cf2 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestInternalHttpClient.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestInternalHttpClient.java
@@ -34,7 +34,6 @@ import org.apache.hc.client5.http.ClientProtocolException;
 import org.apache.hc.client5.http.HttpRoute;
 import org.apache.hc.client5.http.auth.AuthSchemeFactory;
 import org.apache.hc.client5.http.auth.CredentialsProvider;
-import org.apache.hc.client5.http.classic.ExecChain;
 import org.apache.hc.client5.http.classic.ExecChainHandler;
 import org.apache.hc.client5.http.classic.methods.HttpGet;
 import org.apache.hc.client5.http.config.RequestConfig;
@@ -43,7 +42,6 @@ import org.apache.hc.client5.http.cookie.CookieStore;
 import org.apache.hc.client5.http.io.HttpClientConnectionManager;
 import org.apache.hc.client5.http.protocol.HttpClientContext;
 import org.apache.hc.client5.http.routing.HttpRoutePlanner;
-import org.apache.hc.core5.http.ClassicHttpRequest;
 import org.apache.hc.core5.http.HttpException;
 import org.apache.hc.core5.http.HttpHost;
 import org.apache.hc.core5.http.config.Lookup;
@@ -108,9 +106,9 @@ public class TestInternalHttpClient {
         client.execute(httpget);
 
         Mockito.verify(execChain).execute(
-                Mockito.<ClassicHttpRequest>any(),
-                Mockito.<ExecChain.Scope>any(),
-                Mockito.<ExecChain>any());
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any());
     }
 
     @Test(expected=ClientProtocolException.class)
@@ -122,9 +120,9 @@ public class TestInternalHttpClient {
                 Mockito.eq(new HttpHost("somehost")),
                 Mockito.<HttpClientContext>any())).thenReturn(route);
         Mockito.when(execChain.execute(
-                Mockito.<ClassicHttpRequest>any(),
-                Mockito.<ExecChain.Scope>any(),
-                Mockito.<ExecChain>any())).thenThrow(new HttpException());
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any())).thenThrow(new HttpException());
 
         client.execute(httpget);
     }
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestMainClientExec.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestMainClientExec.java
index 1f763f1..d35e938 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestMainClientExec.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestMainClientExec.java
@@ -93,7 +93,7 @@ public class TestMainClientExec {
         Mockito.when(endpoint.execute(
                 Mockito.anyString(),
                 Mockito.same(request),
-                Mockito.<HttpClientContext>any())).thenReturn(response);
+                Mockito.any())).thenReturn(response);
         Mockito.when(reuseStrategy.keepAlive(
                 Mockito.same(request),
                 Mockito.same(response),
@@ -121,7 +121,7 @@ public class TestMainClientExec {
         Mockito.when(endpoint.execute(
                 Mockito.anyString(),
                 Mockito.same(request),
-                Mockito.<HttpClientContext>any())).thenReturn(response);
+                Mockito.any())).thenReturn(response);
         Mockito.when(reuseStrategy.keepAlive(
                 Mockito.same(request),
                 Mockito.same(response),
@@ -153,7 +153,7 @@ public class TestMainClientExec {
         Mockito.when(endpoint.execute(
                 Mockito.anyString(),
                 Mockito.same(request),
-                Mockito.<HttpClientContext>any())).thenReturn(response);
+                Mockito.any())).thenReturn(response);
         Mockito.when(reuseStrategy.keepAlive(
                 Mockito.same(request),
                 Mockito.same(response),
@@ -183,7 +183,7 @@ public class TestMainClientExec {
         Mockito.when(endpoint.execute(
                 Mockito.anyString(),
                 Mockito.same(request),
-                Mockito.<HttpClientContext>any())).thenReturn(response);
+                Mockito.any())).thenReturn(response);
         Mockito.when(reuseStrategy.keepAlive(
                 Mockito.same(request),
                 Mockito.same(response),
@@ -217,7 +217,7 @@ public class TestMainClientExec {
         Mockito.when(endpoint.execute(
                 Mockito.anyString(),
                 Mockito.same(request),
-                Mockito.<HttpClientContext>any())).thenReturn(response);
+                Mockito.any())).thenReturn(response);
         Mockito.when(reuseStrategy.keepAlive(
                 Mockito.same(request),
                 Mockito.same(response),
@@ -246,7 +246,7 @@ public class TestMainClientExec {
         Mockito.when(endpoint.execute(
                 Mockito.anyString(),
                 Mockito.same(request),
-                Mockito.<HttpClientContext>any())).thenThrow(new ConnectionShutdownException());
+                Mockito.any())).thenThrow(new ConnectionShutdownException());
 
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, endpoint, context);
         try {
@@ -266,7 +266,7 @@ public class TestMainClientExec {
         Mockito.when(endpoint.execute(
                 Mockito.anyString(),
                 Mockito.same(request),
-                Mockito.<HttpClientContext>any())).thenThrow(new RuntimeException("Ka-boom"));
+                Mockito.any())).thenThrow(new RuntimeException("Ka-boom"));
 
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, endpoint, context);
         try {
@@ -286,7 +286,7 @@ public class TestMainClientExec {
         Mockito.when(endpoint.execute(
                 Mockito.anyString(),
                 Mockito.same(request),
-                Mockito.<HttpClientContext>any())).thenThrow(new HttpException("Ka-boom"));
+                Mockito.any())).thenThrow(new HttpException("Ka-boom"));
 
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, endpoint, context);
         try {
@@ -306,7 +306,7 @@ public class TestMainClientExec {
         Mockito.when(endpoint.execute(
                 Mockito.anyString(),
                 Mockito.same(request),
-                Mockito.<HttpClientContext>any())).thenThrow(new IOException("Ka-boom"));
+                Mockito.any())).thenThrow(new IOException("Ka-boom"));
 
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, endpoint, context);
         try {
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestProtocolExec.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestProtocolExec.java
index b4b34e9..7de03b3 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestProtocolExec.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestProtocolExec.java
@@ -32,13 +32,10 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.net.URI;
 import java.util.Collections;
-import java.util.Map;
 
 import org.apache.hc.client5.http.AuthenticationStrategy;
 import org.apache.hc.client5.http.HttpRoute;
-import org.apache.hc.client5.http.auth.AuthChallenge;
 import org.apache.hc.client5.http.auth.AuthExchange;
-import org.apache.hc.client5.http.auth.AuthScheme;
 import org.apache.hc.client5.http.auth.AuthScope;
 import org.apache.hc.client5.http.auth.ChallengeType;
 import org.apache.hc.client5.http.auth.Credentials;
@@ -56,13 +53,11 @@ import org.apache.hc.client5.http.impl.auth.NTLMScheme;
 import org.apache.hc.client5.http.protocol.HttpClientContext;
 import org.apache.hc.core5.http.ClassicHttpRequest;
 import org.apache.hc.core5.http.ClassicHttpResponse;
-import org.apache.hc.core5.http.EntityDetails;
 import org.apache.hc.core5.http.HttpException;
 import org.apache.hc.core5.http.HttpHeaders;
 import org.apache.hc.core5.http.HttpHost;
 import org.apache.hc.core5.http.HttpResponse;
 import org.apache.hc.core5.http.message.BasicClassicHttpResponse;
-import org.apache.hc.core5.http.protocol.HttpContext;
 import org.apache.hc.core5.http.protocol.HttpProcessor;
 import org.junit.Assert;
 import org.junit.Before;
@@ -108,8 +103,8 @@ public class TestProtocolExec {
         final ClassicHttpResponse response = Mockito.mock(ClassicHttpResponse.class);
 
         Mockito.when(chain.proceed(
-                Mockito.<ClassicHttpRequest>any(),
-                Mockito.<ExecChain.Scope>any())).thenReturn(response);
+                Mockito.any(),
+                Mockito.any())).thenReturn(response);
 
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, execRuntime, context);
         protocolExec.execute(request, scope, chain);
@@ -132,8 +127,8 @@ public class TestProtocolExec {
 
         final ClassicHttpResponse response = Mockito.mock(ClassicHttpResponse.class);
         Mockito.when(chain.proceed(
-                Mockito.<ClassicHttpRequest>any(),
-                Mockito.<ExecChain.Scope>any())).thenReturn(response);
+                Mockito.any(),
+                Mockito.any())).thenReturn(response);
 
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, execRuntime, context);
         protocolExec.execute(request, scope, chain);
@@ -153,10 +148,10 @@ public class TestProtocolExec {
         final ClassicHttpResponse response = Mockito.mock(ClassicHttpResponse.class);
 
         Mockito.when(chain.proceed(
-                Mockito.<ClassicHttpRequest>any(),
-                Mockito.<ExecChain.Scope>any())).thenReturn(response);
+                Mockito.any(),
+                Mockito.any())).thenReturn(response);
         Mockito.doThrow(new HttpException("Ooopsie")).when(httpProcessor).process(
-                Mockito.same(response), Mockito.<EntityDetails>isNull(), Mockito.<HttpContext>any());
+                Mockito.same(response), Mockito.isNull(), Mockito.any());
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, execRuntime, context);
         try {
             protocolExec.execute(request, scope, chain);
@@ -174,10 +169,10 @@ public class TestProtocolExec {
 
         final ClassicHttpResponse response = Mockito.mock(ClassicHttpResponse.class);
         Mockito.when(chain.proceed(
-                Mockito.<ClassicHttpRequest>any(),
-                Mockito.<ExecChain.Scope>any())).thenReturn(response);
+                Mockito.any(),
+                Mockito.any())).thenReturn(response);
         Mockito.doThrow(new IOException("Ooopsie")).when(httpProcessor).process(
-                Mockito.same(response), Mockito.<EntityDetails>isNull(), Mockito.<HttpContext>any());
+                Mockito.same(response), Mockito.isNull(), Mockito.any());
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, execRuntime, context);
         try {
             protocolExec.execute(request, scope, chain);
@@ -195,10 +190,10 @@ public class TestProtocolExec {
 
         final ClassicHttpResponse response = Mockito.mock(ClassicHttpResponse.class);
         Mockito.when(chain.proceed(
-                Mockito.<ClassicHttpRequest>any(),
-                Mockito.<ExecChain.Scope>any())).thenReturn(response);
+                Mockito.any(),
+                Mockito.any())).thenReturn(response);
         Mockito.doThrow(new RuntimeException("Ooopsie")).when(httpProcessor).process(
-                Mockito.same(response), Mockito.<EntityDetails>isNull(), Mockito.<HttpContext>any());
+                Mockito.same(response), Mockito.isNull(), Mockito.any());
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, execRuntime, context);
         try {
             protocolExec.execute(request, scope, chain);
@@ -231,11 +226,11 @@ public class TestProtocolExec {
 
         Mockito.when(chain.proceed(
                 Mockito.same(request),
-                Mockito.<ExecChain.Scope>any())).thenReturn(response1, response2);
+                Mockito.any())).thenReturn(response1, response2);
         Mockito.when(targetAuthStrategy.select(
                 Mockito.eq(ChallengeType.TARGET),
-                Mockito.<Map<String, AuthChallenge>>any(),
-                Mockito.<HttpClientContext>any())).thenReturn(Collections.<AuthScheme>singletonList(new BasicScheme()));
+                Mockito.any(),
+                Mockito.<HttpClientContext>any())).thenReturn(Collections.singletonList(new BasicScheme()));
         Mockito.when(execRuntime.isConnectionReusable()).thenReturn(true);
 
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, execRuntime, context);
@@ -277,12 +272,12 @@ public class TestProtocolExec {
 
         Mockito.when(chain.proceed(
                 Mockito.same(request),
-                Mockito.<ExecChain.Scope>any())).thenReturn(response1, response2);
+                Mockito.any())).thenReturn(response1, response2);
 
         Mockito.when(targetAuthStrategy.select(
                 Mockito.eq(ChallengeType.TARGET),
-                Mockito.<Map<String, AuthChallenge>>any(),
-                Mockito.<HttpClientContext>any())).thenReturn(Collections.<AuthScheme>singletonList(new BasicScheme()));
+                Mockito.any(),
+                Mockito.<HttpClientContext>any())).thenReturn(Collections.singletonList(new BasicScheme()));
 
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, execRuntime, context);
         final ClassicHttpResponse finalResponse = protocolExec.execute(request, scope, chain);
@@ -317,7 +312,7 @@ public class TestProtocolExec {
 
         Mockito.when(chain.proceed(
                 Mockito.same(request),
-                Mockito.<ExecChain.Scope>any())).thenAnswer((Answer<HttpResponse>) invocationOnMock -> {
+                Mockito.any())).thenAnswer((Answer<HttpResponse>) invocationOnMock -> {
                     final Object[] args = invocationOnMock.getArguments();
                     final ClassicHttpRequest requestEE = (ClassicHttpRequest) args[0];
                     requestEE.getEntity().writeTo(new ByteArrayOutputStream());
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestRedirectExec.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestRedirectExec.java
index d202fe1..d8dbcbf 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestRedirectExec.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/classic/TestRedirectExec.java
@@ -113,10 +113,10 @@ public class TestRedirectExec {
 
         Mockito.when(chain.proceed(
                 ArgumentMatchers.same(request),
-                ArgumentMatchers.<ExecChain.Scope>any())).thenReturn(response1);
+                ArgumentMatchers.any())).thenReturn(response1);
         Mockito.when(chain.proceed(
                 HttpRequestMatcher.matchesRequestUri(redirect),
-                ArgumentMatchers.<ExecChain.Scope>any())).thenReturn(response2);
+                ArgumentMatchers.any())).thenReturn(response2);
 
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, endpoint, context);
         redirectExec.execute(request, scope, chain);
@@ -150,7 +150,7 @@ public class TestRedirectExec {
         final URI redirect = new URI("http://localhost:80/redirect");
         response1.setHeader(HttpHeaders.LOCATION, redirect.toASCIIString());
 
-        Mockito.when(chain.proceed(ArgumentMatchers.<ClassicHttpRequest>any(), ArgumentMatchers.<ExecChain.Scope>any())).thenReturn(response1);
+        Mockito.when(chain.proceed(ArgumentMatchers.any(), ArgumentMatchers.any())).thenReturn(response1);
 
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, endpoint, context);
         redirectExec.execute(request, scope, chain);
@@ -167,7 +167,7 @@ public class TestRedirectExec {
         response1.setHeader(HttpHeaders.LOCATION, redirect.toASCIIString());
         Mockito.when(chain.proceed(
                 ArgumentMatchers.same(request),
-                ArgumentMatchers.<ExecChain.Scope>any())).thenReturn(response1);
+                ArgumentMatchers.any())).thenReturn(response1);
 
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, endpoint, context);
         redirectExec.execute(request, scope, chain);
@@ -197,10 +197,10 @@ public class TestRedirectExec {
         final HttpHost otherHost = new HttpHost("otherhost", 8888);
         Mockito.when(chain.proceed(
                 ArgumentMatchers.same(request),
-                ArgumentMatchers.<ExecChain.Scope>any())).thenReturn(response1);
+                ArgumentMatchers.any())).thenReturn(response1);
         Mockito.when(chain.proceed(
                 HttpRequestMatcher.matchesRequestUri(redirect),
-                ArgumentMatchers.<ExecChain.Scope>any())).thenReturn(response2);
+                ArgumentMatchers.any())).thenReturn(response2);
         Mockito.when(httpRoutePlanner.determineRoute(
                 ArgumentMatchers.eq(otherHost),
                 ArgumentMatchers.<HttpClientContext>any())).thenReturn(new HttpRoute(otherHost));
@@ -241,13 +241,13 @@ public class TestRedirectExec {
 
         Mockito.when(chain.proceed(
                 HttpRequestMatcher.matchesRequestUri(uri),
-                ArgumentMatchers.<ExecChain.Scope>any())).thenReturn(response1);
+                ArgumentMatchers.any())).thenReturn(response1);
         Mockito.when(chain.proceed(
                 HttpRequestMatcher.matchesRequestUri(uri1),
-                ArgumentMatchers.<ExecChain.Scope>any())).thenReturn(response2, response4);
+                ArgumentMatchers.any())).thenReturn(response2, response4);
         Mockito.when(chain.proceed(
                 HttpRequestMatcher.matchesRequestUri(uri2),
-                ArgumentMatchers.<ExecChain.Scope>any())).thenReturn(response3);
+                ArgumentMatchers.any())).thenReturn(response3);
         Mockito.when(httpRoutePlanner.determineRoute(
                 ArgumentMatchers.eq(new HttpHost("localhost")),
                 ArgumentMatchers.<HttpClientContext>any())).thenReturn(route);
@@ -285,13 +285,13 @@ public class TestRedirectExec {
 
         Mockito.when(chain.proceed(
                 HttpRequestMatcher.matchesRequestUri(uri),
-                ArgumentMatchers.<ExecChain.Scope>any())).thenReturn(response1);
+                ArgumentMatchers.any())).thenReturn(response1);
         Mockito.when(chain.proceed(
                 HttpRequestMatcher.matchesRequestUri(uri1),
-                ArgumentMatchers.<ExecChain.Scope>any())).thenReturn(response2);
+                ArgumentMatchers.any())).thenReturn(response2);
         Mockito.when(chain.proceed(
                 HttpRequestMatcher.matchesRequestUri(uri2),
-                ArgumentMatchers.<ExecChain.Scope>any())).thenReturn(response3);
+                ArgumentMatchers.any())).thenReturn(response3);
 
         final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, endpoint, context);
         redirectExec.execute(request, scope, chain);
@@ -308,7 +308,7 @@ public class TestRedirectExec {
         response1.setHeader(HttpHeaders.LOCATION, redirect.toASCIIString());
         Mockito.when(chain.proceed(
                 ArgumentMatchers.same(request),
-                ArgumentMatchers.<ExecChain.Scope>any())).thenReturn(response1);
+                ArgumentMatchers.any())).thenReturn(response1);
         Mockito.doThrow(new RuntimeException("Oppsie")).when(redirectStrategy).getLocationURI(
                 ArgumentMatchers.<ClassicHttpRequest>any(),
                 ArgumentMatchers.<ClassicHttpResponse>any(),
@@ -339,7 +339,7 @@ public class TestRedirectExec {
         response1.setEntity(entity1);
         Mockito.when(chain.proceed(
                 ArgumentMatchers.same(request),
-                ArgumentMatchers.<ExecChain.Scope>any())).thenReturn(response1);
+                ArgumentMatchers.any())).thenReturn(response1);
         Mockito.doThrow(new ProtocolException("Oppsie")).when(redirectStrategy).getLocationURI(
                 ArgumentMatchers.<ClassicHttpRequest>any(),
                 ArgumentMatchers.<ClassicHttpResponse>any(),
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/cookie/TestRFC6265CookieSpec.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/cookie/TestRFC6265CookieSpec.java
index 55e9b8c..210d7a7 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/cookie/TestRFC6265CookieSpec.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/cookie/TestRFC6265CookieSpec.java
@@ -35,7 +35,6 @@ import org.apache.hc.client5.http.cookie.CommonCookieAttributeHandler;
 import org.apache.hc.client5.http.cookie.Cookie;
 import org.apache.hc.client5.http.cookie.CookieOrigin;
 import org.apache.hc.client5.http.cookie.MalformedCookieException;
-import org.apache.hc.client5.http.cookie.SetCookie;
 import org.apache.hc.core5.http.Header;
 import org.apache.hc.core5.http.message.BasicHeader;
 import org.junit.Assert;
@@ -67,8 +66,8 @@ public class TestRFC6265CookieSpec {
         Assert.assertEquals("stuff", cookie.getAttribute("this"));
         Assert.assertEquals(null, cookie.getAttribute("that"));
 
-        Mockito.verify(h1).parse(ArgumentMatchers.<SetCookie>any(), ArgumentMatchers.eq("stuff"));
-        Mockito.verify(h2, Mockito.never()).parse(ArgumentMatchers.<SetCookie>any(), ArgumentMatchers.anyString());
+        Mockito.verify(h1).parse(ArgumentMatchers.any(), ArgumentMatchers.eq("stuff"));
+        Mockito.verify(h2, Mockito.never()).parse(ArgumentMatchers.any(), ArgumentMatchers.anyString());
     }
 
     @Test
@@ -298,8 +297,8 @@ public class TestRFC6265CookieSpec {
         final CookieOrigin origin = new CookieOrigin("host", 80, "/path/", true);
         cookiespec.parse(header, origin);
 
-        Mockito.verify(h1).parse(ArgumentMatchers.<SetCookie>any(), ArgumentMatchers.eq("morestuff"));
-        Mockito.verify(h1, Mockito.times(1)).parse(ArgumentMatchers.<SetCookie>any(), ArgumentMatchers.anyString());
+        Mockito.verify(h1).parse(ArgumentMatchers.any(), ArgumentMatchers.eq("morestuff"));
+        Mockito.verify(h1, Mockito.times(1)).parse(ArgumentMatchers.any(), ArgumentMatchers.anyString());
     }
 
     @Test
@@ -315,8 +314,8 @@ public class TestRFC6265CookieSpec {
         final CookieOrigin origin = new CookieOrigin("host", 80, "/path/", true);
         cookiespec.parse(header, origin);
 
-        Mockito.verify(h1, Mockito.never()).parse(ArgumentMatchers.<SetCookie>any(), ArgumentMatchers.anyString());
-        Mockito.verify(h2).parse(ArgumentMatchers.<SetCookie>any(), ArgumentMatchers.eq("otherstuff"));
+        Mockito.verify(h1, Mockito.never()).parse(ArgumentMatchers.any(), ArgumentMatchers.anyString());
+        Mockito.verify(h2).parse(ArgumentMatchers.any(), ArgumentMatchers.eq("otherstuff"));
     }
 
 }
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestBasicHttpClientConnectionManager.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestBasicHttpClientConnectionManager.java
index cd0795f..c4f2e32 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestBasicHttpClientConnectionManager.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestBasicHttpClientConnectionManager.java
@@ -44,7 +44,6 @@ import org.apache.hc.core5.http.HttpHost;
 import org.apache.hc.core5.http.config.Lookup;
 import org.apache.hc.core5.http.io.HttpConnectionFactory;
 import org.apache.hc.core5.http.io.SocketConfig;
-import org.apache.hc.core5.http.protocol.HttpContext;
 import org.apache.hc.core5.io.CloseMode;
 import org.apache.hc.core5.util.TimeValue;
 import org.apache.hc.core5.util.Timeout;
@@ -90,7 +89,7 @@ public class TestBasicHttpClientConnectionManager {
         final HttpHost target = new HttpHost("localhost", 80);
         final HttpRoute route = new HttpRoute(target);
 
-        Mockito.when(connFactory.createConnection(Mockito.<Socket>any())).thenReturn(conn);
+        Mockito.when(connFactory.createConnection(Mockito.any())).thenReturn(conn);
 
         final LeaseRequest connRequest1 = mgr.lease("some-id", route, null);
         final ConnectionEndpoint endpoint1 = connRequest1.get(Timeout.ZERO_MILLISECONDS);
@@ -107,7 +106,7 @@ public class TestBasicHttpClientConnectionManager {
         Assert.assertNotNull(conn2);
         Assert.assertFalse(conn2.isConnected());
 
-        Mockito.verify(connFactory, Mockito.times(2)).createConnection(Mockito.<Socket>any());
+        Mockito.verify(connFactory, Mockito.times(2)).createConnection(Mockito.any());
     }
 
     @Test
@@ -115,13 +114,13 @@ public class TestBasicHttpClientConnectionManager {
         final HttpHost target = new HttpHost("somehost", 80);
         final HttpRoute route = new HttpRoute(target);
 
-        Mockito.when(connFactory.createConnection(Mockito.<Socket>any())).thenReturn(conn);
+        Mockito.when(connFactory.createConnection(Mockito.any())).thenReturn(conn);
 
         final LeaseRequest connRequest1 = mgr.lease("some-id", route, null);
         final ConnectionEndpoint endpoint1 = connRequest1.get(Timeout.ZERO_MILLISECONDS);
         Assert.assertNotNull(endpoint1);
 
-        Mockito.verify(connFactory, Mockito.times(1)).createConnection(Mockito.<Socket>any());
+        Mockito.verify(connFactory, Mockito.times(1)).createConnection(Mockito.any());
 
         Mockito.when(conn.isOpen()).thenReturn(Boolean.TRUE);
 
@@ -135,7 +134,7 @@ public class TestBasicHttpClientConnectionManager {
         Assert.assertNotNull(conn2);
         Assert.assertTrue(conn2.isConnected());
 
-        Mockito.verify(connFactory, Mockito.times(1)).createConnection(Mockito.<Socket>any());
+        Mockito.verify(connFactory, Mockito.times(1)).createConnection(Mockito.any());
     }
 
     @Test
@@ -143,13 +142,13 @@ public class TestBasicHttpClientConnectionManager {
         final HttpHost target = new HttpHost("somehost", 80);
         final HttpRoute route = new HttpRoute(target);
 
-        Mockito.when(connFactory.createConnection(Mockito.<Socket>any())).thenReturn(conn);
+        Mockito.when(connFactory.createConnection(Mockito.any())).thenReturn(conn);
 
         final LeaseRequest connRequest1 = mgr.lease("some-id", route, "some state");
         final ConnectionEndpoint endpoint1 = connRequest1.get(Timeout.ZERO_MILLISECONDS);
         Assert.assertNotNull(endpoint1);
 
-        Mockito.verify(connFactory, Mockito.times(1)).createConnection(Mockito.<Socket>any());
+        Mockito.verify(connFactory, Mockito.times(1)).createConnection(Mockito.any());
 
         Mockito.when(conn.isOpen()).thenReturn(Boolean.TRUE);
 
@@ -163,7 +162,7 @@ public class TestBasicHttpClientConnectionManager {
         Assert.assertNotNull(conn2);
         Assert.assertTrue(conn2.isConnected());
 
-        Mockito.verify(connFactory, Mockito.times(1)).createConnection(Mockito.<Socket>any());
+        Mockito.verify(connFactory, Mockito.times(1)).createConnection(Mockito.any());
     }
 
     @Test
@@ -171,13 +170,13 @@ public class TestBasicHttpClientConnectionManager {
         final HttpHost target1 = new HttpHost("somehost", 80);
         final HttpRoute route1 = new HttpRoute(target1);
 
-        Mockito.when(connFactory.createConnection(Mockito.<Socket>any())).thenReturn(conn);
+        Mockito.when(connFactory.createConnection(Mockito.any())).thenReturn(conn);
 
         final LeaseRequest connRequest1 = mgr.lease("some-id", route1, null);
         final ConnectionEndpoint endpoint1 = connRequest1.get(Timeout.ZERO_MILLISECONDS);
         Assert.assertNotNull(endpoint1);
 
-        Mockito.verify(connFactory, Mockito.times(1)).createConnection(Mockito.<Socket>any());
+        Mockito.verify(connFactory, Mockito.times(1)).createConnection(Mockito.any());
 
         Mockito.when(conn.isOpen()).thenReturn(Boolean.TRUE, Boolean.FALSE);
 
@@ -194,7 +193,7 @@ public class TestBasicHttpClientConnectionManager {
         Assert.assertFalse(conn2.isConnected());
 
         Mockito.verify(conn).close(CloseMode.GRACEFUL);
-        Mockito.verify(connFactory, Mockito.times(2)).createConnection(Mockito.<Socket>any());
+        Mockito.verify(connFactory, Mockito.times(2)).createConnection(Mockito.any());
     }
 
     @Test
@@ -202,13 +201,13 @@ public class TestBasicHttpClientConnectionManager {
         final HttpHost target = new HttpHost("somehost", 80);
         final HttpRoute route = new HttpRoute(target);
 
-        Mockito.when(connFactory.createConnection(Mockito.<Socket>any())).thenReturn(conn);
+        Mockito.when(connFactory.createConnection(Mockito.any())).thenReturn(conn);
 
         final LeaseRequest connRequest1 = mgr.lease("some-id", route, null);
         final ConnectionEndpoint endpoint1 = connRequest1.get(Timeout.ZERO_MILLISECONDS);
         Assert.assertNotNull(endpoint1);
 
-        Mockito.verify(connFactory, Mockito.times(1)).createConnection(Mockito.<Socket>any());
+        Mockito.verify(connFactory, Mockito.times(1)).createConnection(Mockito.any());
 
         Mockito.when(conn.isOpen()).thenReturn(Boolean.TRUE, Boolean.FALSE);
 
@@ -225,7 +224,7 @@ public class TestBasicHttpClientConnectionManager {
         Assert.assertFalse(conn2.isConnected());
 
         Mockito.verify(conn).close(CloseMode.GRACEFUL);
-        Mockito.verify(connFactory, Mockito.times(2)).createConnection(Mockito.<Socket>any());
+        Mockito.verify(connFactory, Mockito.times(2)).createConnection(Mockito.any());
     }
 
     @Test(expected=NullPointerException.class)
@@ -244,13 +243,13 @@ public class TestBasicHttpClientConnectionManager {
         final HttpHost target = new HttpHost("somehost", 80);
         final HttpRoute route = new HttpRoute(target);
 
-        Mockito.when(connFactory.createConnection(Mockito.<Socket>any())).thenReturn(conn);
+        Mockito.when(connFactory.createConnection(Mockito.any())).thenReturn(conn);
 
         final LeaseRequest connRequest1 = mgr.lease("some-id", route, null);
         final ConnectionEndpoint endpoint1 = connRequest1.get(Timeout.ZERO_MILLISECONDS);
         Assert.assertNotNull(endpoint1);
 
-        Mockito.verify(connFactory, Mockito.times(1)).createConnection(Mockito.<Socket>any());
+        Mockito.verify(connFactory, Mockito.times(1)).createConnection(Mockito.any());
 
         Mockito.when(conn.isOpen()).thenReturn(Boolean.TRUE);
 
@@ -280,13 +279,13 @@ public class TestBasicHttpClientConnectionManager {
         final HttpHost target = new HttpHost("somehost", 80);
         final HttpRoute route = new HttpRoute(target);
 
-        Mockito.when(connFactory.createConnection(Mockito.<Socket>any())).thenReturn(conn);
+        Mockito.when(connFactory.createConnection(Mockito.any())).thenReturn(conn);
 
         final LeaseRequest connRequest1 = mgr.lease("some-id", route, null);
         final ConnectionEndpoint endpoint1 = connRequest1.get(Timeout.ZERO_MILLISECONDS);
         Assert.assertNotNull(endpoint1);
 
-        Mockito.verify(connFactory, Mockito.times(1)).createConnection(Mockito.<Socket>any());
+        Mockito.verify(connFactory, Mockito.times(1)).createConnection(Mockito.any());
 
         Mockito.when(conn.isOpen()).thenReturn(Boolean.TRUE, Boolean.FALSE);
 
@@ -307,13 +306,13 @@ public class TestBasicHttpClientConnectionManager {
         final HttpHost target = new HttpHost("somehost", 80);
         final HttpRoute route = new HttpRoute(target);
 
-        Mockito.when(connFactory.createConnection(Mockito.<Socket>any())).thenReturn(conn);
+        Mockito.when(connFactory.createConnection(Mockito.any())).thenReturn(conn);
 
         final LeaseRequest connRequest1 = mgr.lease("some-id", route, null);
         final ConnectionEndpoint endpoint1 = connRequest1.get(Timeout.ZERO_MILLISECONDS);
         Assert.assertNotNull(endpoint1);
 
-        Mockito.verify(connFactory, Mockito.times(1)).createConnection(Mockito.<Socket>any());
+        Mockito.verify(connFactory, Mockito.times(1)).createConnection(Mockito.any());
 
         Mockito.when(conn.isOpen()).thenReturn(Boolean.TRUE, Boolean.FALSE);
 
@@ -334,7 +333,7 @@ public class TestBasicHttpClientConnectionManager {
         final HttpHost target = new HttpHost("somehost", 80);
         final HttpRoute route = new HttpRoute(target);
 
-        Mockito.when(connFactory.createConnection(Mockito.<Socket>any())).thenReturn(conn);
+        Mockito.when(connFactory.createConnection(Mockito.any())).thenReturn(conn);
 
         final LeaseRequest connRequest1 = mgr.lease("some-id", route, null);
         final ConnectionEndpoint endpoint1 = connRequest1.get(Timeout.ZERO_MILLISECONDS);
@@ -352,7 +351,7 @@ public class TestBasicHttpClientConnectionManager {
         final InetAddress local = InetAddress.getByAddress(new byte[] {127, 0, 0, 1});
         final HttpRoute route = new HttpRoute(target, local, true);
 
-        Mockito.when(connFactory.createConnection(Mockito.<Socket>any())).thenReturn(conn);
+        Mockito.when(connFactory.createConnection(Mockito.any())).thenReturn(conn);
 
         final LeaseRequest connRequest1 = mgr.lease("some-id", route, null);
         final ConnectionEndpoint endpoint1 = connRequest1.get(Timeout.ZERO_MILLISECONDS);
@@ -366,14 +365,14 @@ public class TestBasicHttpClientConnectionManager {
         Mockito.when(dnsResolver.resolve("somehost")).thenReturn(new InetAddress[] {remote});
         Mockito.when(schemePortResolver.resolve(target)).thenReturn(8443);
         Mockito.when(socketFactoryRegistry.lookup("https")).thenReturn(plainSocketFactory);
-        Mockito.when(plainSocketFactory.createSocket(Mockito.<HttpContext>any())).thenReturn(socket);
+        Mockito.when(plainSocketFactory.createSocket(Mockito.any())).thenReturn(socket);
         Mockito.when(plainSocketFactory.connectSocket(
-                Mockito.<TimeValue>any(),
+                Mockito.any(),
                 Mockito.eq(socket),
-                Mockito.<HttpHost>any(),
-                Mockito.<InetSocketAddress>any(),
-                Mockito.<InetSocketAddress>any(),
-                Mockito.<HttpContext>any())).thenReturn(socket);
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any())).thenReturn(socket);
 
         mgr.connect(endpoint1, TimeValue.ofMilliseconds(123), context);
 
@@ -393,7 +392,7 @@ public class TestBasicHttpClientConnectionManager {
         final InetAddress local = InetAddress.getByAddress(new byte[] {127, 0, 0, 1});
         final HttpRoute route = new HttpRoute(target, local, proxy, true);
 
-        Mockito.when(connFactory.createConnection(Mockito.<Socket>any())).thenReturn(conn);
+        Mockito.when(connFactory.createConnection(Mockito.any())).thenReturn(conn);
 
         final LeaseRequest connRequest1 = mgr.lease("some-id", route, null);
         final ConnectionEndpoint endpoint1 = connRequest1.get(Timeout.ZERO_MILLISECONDS);
@@ -409,14 +408,14 @@ public class TestBasicHttpClientConnectionManager {
         Mockito.when(schemePortResolver.resolve(target)).thenReturn(8443);
         Mockito.when(socketFactoryRegistry.lookup("http")).thenReturn(plainSocketFactory);
         Mockito.when(socketFactoryRegistry.lookup("https")).thenReturn(sslSocketFactory);
-        Mockito.when(plainSocketFactory.createSocket(Mockito.<HttpContext>any())).thenReturn(socket);
+        Mockito.when(plainSocketFactory.createSocket(Mockito.any())).thenReturn(socket);
         Mockito.when(plainSocketFactory.connectSocket(
-                Mockito.<TimeValue>any(),
+                Mockito.any(),
                 Mockito.eq(socket),
-                Mockito.<HttpHost>any(),
-                Mockito.<InetSocketAddress>any(),
-                Mockito.<InetSocketAddress>any(),
-                Mockito.<HttpContext>any())).thenReturn(socket);
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any())).thenReturn(socket);
 
         mgr.connect(endpoint1, TimeValue.ofMilliseconds(123), context);
 
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestHttpClientConnectionOperator.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestHttpClientConnectionOperator.java
index 87b81d1..5a43d41 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestHttpClientConnectionOperator.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestHttpClientConnectionOperator.java
@@ -88,14 +88,14 @@ public class TestHttpClientConnectionOperator {
         Mockito.when(dnsResolver.resolve("somehost")).thenReturn(new InetAddress[] { ip1, ip2 });
         Mockito.when(socketFactoryRegistry.lookup("http")).thenReturn(plainSocketFactory);
         Mockito.when(schemePortResolver.resolve(host)).thenReturn(80);
-        Mockito.when(plainSocketFactory.createSocket(Mockito.<HttpContext>any())).thenReturn(socket);
+        Mockito.when(plainSocketFactory.createSocket(Mockito.any())).thenReturn(socket);
         Mockito.when(plainSocketFactory.connectSocket(
-                Mockito.<TimeValue>any(),
-                Mockito.<Socket>any(),
-                Mockito.<HttpHost>any(),
-                Mockito.<InetSocketAddress>any(),
-                Mockito.<InetSocketAddress>any(),
-                Mockito.<HttpContext>any())).thenReturn(socket);
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any())).thenReturn(socket);
 
         final SocketConfig socketConfig = SocketConfig.custom()
             .setSoKeepAlive(true)
@@ -133,14 +133,14 @@ public class TestHttpClientConnectionOperator {
         Mockito.when(dnsResolver.resolve("somehost")).thenReturn(new InetAddress[] { ip1, ip2 });
         Mockito.when(socketFactoryRegistry.lookup("http")).thenReturn(plainSocketFactory);
         Mockito.when(schemePortResolver.resolve(host)).thenReturn(80);
-        Mockito.when(plainSocketFactory.createSocket(Mockito.<HttpContext>any())).thenReturn(socket);
+        Mockito.when(plainSocketFactory.createSocket(Mockito.any())).thenReturn(socket);
         Mockito.when(plainSocketFactory.connectSocket(
-                Mockito.<TimeValue>any(),
-                Mockito.<Socket>any(),
-                Mockito.<HttpHost>any(),
-                Mockito.<InetSocketAddress>any(),
-                Mockito.<InetSocketAddress>any(),
-                Mockito.<HttpContext>any())).thenThrow(new SocketTimeoutException());
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any())).thenThrow(new SocketTimeoutException());
 
         connectionOperator.connect(conn, host, null, TimeValue.ofMilliseconds(1000), SocketConfig.DEFAULT, context);
     }
@@ -155,14 +155,14 @@ public class TestHttpClientConnectionOperator {
         Mockito.when(dnsResolver.resolve("somehost")).thenReturn(new InetAddress[] { ip1, ip2 });
         Mockito.when(socketFactoryRegistry.lookup("http")).thenReturn(plainSocketFactory);
         Mockito.when(schemePortResolver.resolve(host)).thenReturn(80);
-        Mockito.when(plainSocketFactory.createSocket(Mockito.<HttpContext>any())).thenReturn(socket);
+        Mockito.when(plainSocketFactory.createSocket(Mockito.any())).thenReturn(socket);
         Mockito.when(plainSocketFactory.connectSocket(
-                Mockito.<TimeValue>any(),
-                Mockito.<Socket>any(),
-                Mockito.<HttpHost>any(),
-                Mockito.<InetSocketAddress>any(),
-                Mockito.<InetSocketAddress>any(),
-                Mockito.<HttpContext>any())).thenThrow(new ConnectException());
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any())).thenThrow(new ConnectException());
 
         connectionOperator.connect(conn, host, null, TimeValue.ofMilliseconds(1000), SocketConfig.DEFAULT, context);
     }
@@ -178,21 +178,21 @@ public class TestHttpClientConnectionOperator {
         Mockito.when(dnsResolver.resolve("somehost")).thenReturn(new InetAddress[] { ip1, ip2 });
         Mockito.when(socketFactoryRegistry.lookup("http")).thenReturn(plainSocketFactory);
         Mockito.when(schemePortResolver.resolve(host)).thenReturn(80);
-        Mockito.when(plainSocketFactory.createSocket(Mockito.<HttpContext>any())).thenReturn(socket);
+        Mockito.when(plainSocketFactory.createSocket(Mockito.any())).thenReturn(socket);
         Mockito.when(plainSocketFactory.connectSocket(
-                Mockito.<TimeValue>any(),
-                Mockito.<Socket>any(),
-                Mockito.<HttpHost>any(),
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any(),
                 Mockito.eq(new InetSocketAddress(ip1, 80)),
-                Mockito.<InetSocketAddress>any(),
-                Mockito.<HttpContext>any())).thenThrow(new ConnectException());
+                Mockito.any(),
+                Mockito.any())).thenThrow(new ConnectException());
         Mockito.when(plainSocketFactory.connectSocket(
-                Mockito.<TimeValue>any(),
-                Mockito.<Socket>any(),
-                Mockito.<HttpHost>any(),
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any(),
                 Mockito.eq(new InetSocketAddress(ip2, 80)),
-                Mockito.<InetSocketAddress>any(),
-                Mockito.<HttpContext>any())).thenReturn(socket);
+                Mockito.any(),
+                Mockito.any())).thenReturn(socket);
 
         final InetSocketAddress localAddress = new InetSocketAddress(local, 0);
         connectionOperator.connect(conn, host, localAddress, TimeValue.ofMilliseconds(1000), SocketConfig.DEFAULT, context);
@@ -216,14 +216,14 @@ public class TestHttpClientConnectionOperator {
 
         Mockito.when(socketFactoryRegistry.lookup("http")).thenReturn(plainSocketFactory);
         Mockito.when(schemePortResolver.resolve(host)).thenReturn(80);
-        Mockito.when(plainSocketFactory.createSocket(Mockito.<HttpContext>any())).thenReturn(socket);
+        Mockito.when(plainSocketFactory.createSocket(Mockito.any())).thenReturn(socket);
         Mockito.when(plainSocketFactory.connectSocket(
-                Mockito.<TimeValue>any(),
-                Mockito.<Socket>any(),
-                Mockito.<HttpHost>any(),
-                Mockito.<InetSocketAddress>any(),
-                Mockito.<InetSocketAddress>any(),
-                Mockito.<HttpContext>any())).thenReturn(socket);
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any())).thenReturn(socket);
 
         final InetSocketAddress localAddress = new InetSocketAddress(local, 0);
         connectionOperator.connect(conn, host, localAddress, TimeValue.ofMilliseconds(1000), SocketConfig.DEFAULT, context);
@@ -248,12 +248,12 @@ public class TestHttpClientConnectionOperator {
         Mockito.when(conn.getSocket()).thenReturn(socket);
         Mockito.when(socketFactoryRegistry.lookup("https")).thenReturn(sslSocketFactory);
         Mockito.when(schemePortResolver.resolve(host)).thenReturn(443);
-        Mockito.when(sslSocketFactory.createSocket(Mockito.<HttpContext>any())).thenReturn(socket);
+        Mockito.when(sslSocketFactory.createSocket(Mockito.any())).thenReturn(socket);
         Mockito.when(sslSocketFactory.createLayeredSocket(
-                Mockito.<Socket>any(),
+                Mockito.any(),
                 Mockito.eq("somehost"),
                 Mockito.eq(443),
-                Mockito.<HttpContext>any())).thenReturn(socket);
+                Mockito.any())).thenReturn(socket);
 
         connectionOperator.upgrade(conn, host, context);
 
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestPoolingHttpClientConnectionManager.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestPoolingHttpClientConnectionManager.java
index d0e0c04..341376a 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestPoolingHttpClientConnectionManager.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestPoolingHttpClientConnectionManager.java
@@ -44,11 +44,9 @@ import org.apache.hc.client5.http.io.ManagedHttpClientConnection;
 import org.apache.hc.client5.http.protocol.HttpClientContext;
 import org.apache.hc.client5.http.socket.ConnectionSocketFactory;
 import org.apache.hc.client5.http.socket.LayeredConnectionSocketFactory;
-import org.apache.hc.core5.concurrent.FutureCallback;
 import org.apache.hc.core5.http.HttpHost;
 import org.apache.hc.core5.http.config.Lookup;
 import org.apache.hc.core5.http.io.SocketConfig;
-import org.apache.hc.core5.http.protocol.HttpContext;
 import org.apache.hc.core5.pool.PoolEntry;
 import org.apache.hc.core5.pool.StrictConnPool;
 import org.apache.hc.core5.util.TimeValue;
@@ -111,8 +109,8 @@ public class TestPoolingHttpClientConnectionManager {
         Mockito.when(pool.lease(
                 Mockito.eq(route),
                 Mockito.eq(null),
-                Mockito.<Timeout>any(),
-                Mockito.<FutureCallback<PoolEntry<HttpRoute, ManagedHttpClientConnection>>>eq(null)))
+                Mockito.any(),
+                Mockito.eq(null)))
                 .thenReturn(future);
 
         final LeaseRequest connRequest1 = mgr.lease("some-id", route, null);
@@ -139,8 +137,8 @@ public class TestPoolingHttpClientConnectionManager {
         Mockito.when(pool.lease(
                 Mockito.eq(route),
                 Mockito.eq(null),
-                Mockito.<Timeout>any(),
-                Mockito.<FutureCallback<PoolEntry<HttpRoute, ManagedHttpClientConnection>>>eq(null)))
+                Mockito.any(),
+                Mockito.eq(null)))
                 .thenReturn(future);
 
         final LeaseRequest connRequest1 = mgr.lease("some-id", route, null);
@@ -166,8 +164,8 @@ public class TestPoolingHttpClientConnectionManager {
         Mockito.when(pool.lease(
                 Mockito.eq(route),
                 Mockito.eq(null),
-                Mockito.<Timeout>any(),
-                Mockito.<FutureCallback<PoolEntry<HttpRoute, ManagedHttpClientConnection>>>eq(null)))
+                Mockito.any(),
+                Mockito.eq(null)))
                 .thenReturn(future);
 
         final LeaseRequest connRequest1 = mgr.lease("some-id", route, null);
@@ -183,8 +181,8 @@ public class TestPoolingHttpClientConnectionManager {
         Mockito.when(pool.lease(
                 Mockito.eq(route),
                 Mockito.eq(null),
-                Mockito.<Timeout>any(),
-                Mockito.<FutureCallback<PoolEntry<HttpRoute, ManagedHttpClientConnection>>>eq(null)))
+                Mockito.any(),
+                Mockito.eq(null)))
                 .thenReturn(future);
 
         final LeaseRequest connRequest1 = mgr.lease("some-id", route, null);
@@ -204,8 +202,8 @@ public class TestPoolingHttpClientConnectionManager {
         Mockito.when(pool.lease(
                 Mockito.eq(route),
                 Mockito.eq(null),
-                Mockito.<Timeout>any(),
-                Mockito.<FutureCallback<PoolEntry<HttpRoute, ManagedHttpClientConnection>>>eq(null)))
+                Mockito.any(),
+                Mockito.eq(null)))
                 .thenReturn(future);
         Mockito.when(conn.isOpen()).thenReturn(true);
         Mockito.when(conn.isConsistent()).thenReturn(true);
@@ -234,8 +232,8 @@ public class TestPoolingHttpClientConnectionManager {
         Mockito.when(pool.lease(
                 Mockito.eq(route),
                 Mockito.eq(null),
-                Mockito.<Timeout>any(),
-                Mockito.<FutureCallback<PoolEntry<HttpRoute, ManagedHttpClientConnection>>>eq(null)))
+                Mockito.any(),
+                Mockito.eq(null)))
                 .thenReturn(future);
         Mockito.when(conn.isOpen()).thenReturn(Boolean.FALSE);
 
@@ -267,8 +265,8 @@ public class TestPoolingHttpClientConnectionManager {
         Mockito.when(pool.lease(
                 Mockito.eq(route),
                 Mockito.eq(null),
-                Mockito.<Timeout>any(),
-                Mockito.<FutureCallback<PoolEntry<HttpRoute, ManagedHttpClientConnection>>>eq(null)))
+                Mockito.any(),
+                Mockito.eq(null)))
                 .thenReturn(future);
 
         final LeaseRequest connRequest1 = mgr.lease("some-id", route, null);
@@ -283,14 +281,14 @@ public class TestPoolingHttpClientConnectionManager {
         Mockito.when(dnsResolver.resolve("somehost")).thenReturn(new InetAddress[]{remote});
         Mockito.when(schemePortResolver.resolve(target)).thenReturn(8443);
         Mockito.when(socketFactoryRegistry.lookup("https")).thenReturn(plainSocketFactory);
-        Mockito.when(plainSocketFactory.createSocket(Mockito.<HttpContext>any())).thenReturn(socket);
+        Mockito.when(plainSocketFactory.createSocket(Mockito.any())).thenReturn(socket);
         Mockito.when(plainSocketFactory.connectSocket(
-                Mockito.<TimeValue>any(),
+                Mockito.any(),
                 Mockito.eq(socket),
-                Mockito.<HttpHost>any(),
-                Mockito.<InetSocketAddress>any(),
-                Mockito.<InetSocketAddress>any(),
-                Mockito.<HttpContext>any())).thenReturn(socket);
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any())).thenReturn(socket);
 
         mgr.connect(endpoint1, TimeValue.ofMilliseconds(123), context);
 
@@ -320,8 +318,8 @@ public class TestPoolingHttpClientConnectionManager {
         Mockito.when(pool.lease(
                 Mockito.eq(route),
                 Mockito.eq(null),
-                Mockito.<Timeout>any(),
-                Mockito.<FutureCallback<PoolEntry<HttpRoute, ManagedHttpClientConnection>>>eq(null)))
+                Mockito.any(),
+                Mockito.eq(null)))
                 .thenReturn(future);
 
         final LeaseRequest connRequest1 = mgr.lease("some-id", route, null);
@@ -341,14 +339,14 @@ public class TestPoolingHttpClientConnectionManager {
         Mockito.when(schemePortResolver.resolve(target)).thenReturn(8443);
         Mockito.when(socketFactoryRegistry.lookup("http")).thenReturn(plainsf);
         Mockito.when(socketFactoryRegistry.lookup("https")).thenReturn(sslsf);
-        Mockito.when(plainsf.createSocket(Mockito.<HttpContext>any())).thenReturn(mockSock);
+        Mockito.when(plainsf.createSocket(Mockito.any())).thenReturn(mockSock);
         Mockito.when(plainsf.connectSocket(
-                Mockito.<TimeValue>any(),
+                Mockito.any(),
                 Mockito.eq(mockSock),
-                Mockito.<HttpHost>any(),
-                Mockito.<InetSocketAddress>any(),
-                Mockito.<InetSocketAddress>any(),
-                Mockito.<HttpContext>any())).thenReturn(mockSock);
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any(),
+                Mockito.any())).thenReturn(mockSock);
 
         mgr.connect(endpoint1, TimeValue.ofMilliseconds(123), context);
 
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/routing/TestDefaultRoutePlanner.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/routing/TestDefaultRoutePlanner.java
index c6e9cb7..d7feda1 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/routing/TestDefaultRoutePlanner.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/routing/TestDefaultRoutePlanner.java
@@ -65,7 +65,7 @@ public class TestDefaultRoutePlanner {
         Assert.assertEquals(target, route.getTargetHost());
         Assert.assertEquals(1, route.getHopCount());
         Assert.assertFalse(route.isSecure());
-        Mockito.verify(schemePortResolver, Mockito.never()).resolve(Mockito.<HttpHost>any());
+        Mockito.verify(schemePortResolver, Mockito.never()).resolve(Mockito.any());
     }
 
     @Test
@@ -94,7 +94,7 @@ public class TestDefaultRoutePlanner {
         Assert.assertEquals(proxy, route.getProxyHost());
         Assert.assertEquals(2, route.getHopCount());
         Assert.assertFalse(route.isSecure());
-        Mockito.verify(schemePortResolver, Mockito.never()).resolve(Mockito.<HttpHost>any());
+        Mockito.verify(schemePortResolver, Mockito.never()).resolve(Mockito.any());
     }
 
     @Test(expected= ProtocolException.class)
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/routing/TestSystemDefaultRoutePlanner.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/routing/TestSystemDefaultRoutePlanner.java
index 547bec0..96dff16 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/routing/TestSystemDefaultRoutePlanner.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/routing/TestSystemDefaultRoutePlanner.java
@@ -73,7 +73,7 @@ public class TestSystemDefaultRoutePlanner {
         Assert.assertEquals(target, route.getTargetHost());
         Assert.assertEquals(1, route.getHopCount());
         Assert.assertFalse(route.isSecure());
-        Mockito.verify(schemePortResolver, Mockito.never()).resolve(ArgumentMatchers.<HttpHost>any());
+        Mockito.verify(schemePortResolver, Mockito.never()).resolve(ArgumentMatchers.any());
     }
 
     @Test
diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/protocol/TestRequestAddCookies.java b/httpclient5/src/test/java/org/apache/hc/client5/http/protocol/TestRequestAddCookies.java
index 6bc26fc..a86d19d 100644
--- a/httpclient5/src/test/java/org/apache/hc/client5/http/protocol/TestRequestAddCookies.java
+++ b/httpclient5/src/test/java/org/apache/hc/client5/http/protocol/TestRequestAddCookies.java
@@ -31,13 +31,13 @@ import java.util.Date;
 import org.apache.hc.client5.http.HttpRoute;
 import org.apache.hc.client5.http.RouteInfo.LayerType;
 import org.apache.hc.client5.http.RouteInfo.TunnelType;
-import org.apache.hc.client5.http.cookie.StandardCookieSpec;
 import org.apache.hc.client5.http.config.RequestConfig;
 import org.apache.hc.client5.http.cookie.BasicCookieStore;
 import org.apache.hc.client5.http.cookie.CookieOrigin;
 import org.apache.hc.client5.http.cookie.CookieSpec;
 import org.apache.hc.client5.http.cookie.CookieSpecFactory;
 import org.apache.hc.client5.http.cookie.CookieStore;
+import org.apache.hc.client5.http.cookie.StandardCookieSpec;
 import org.apache.hc.client5.http.impl.cookie.BasicClientCookie;
 import org.apache.hc.client5.http.impl.cookie.IgnoreCookieSpecFactory;
 import org.apache.hc.client5.http.impl.cookie.RFC6265CookieSpecFactory;
@@ -344,7 +344,7 @@ public class TestRequestAddCookies {
         Assert.assertEquals(1, headers.length);
         Assert.assertEquals("name1=value1; name2=value2", headers[0].getValue());
 
-        Mockito.verify(this.cookieStore, Mockito.times(1)).clearExpired(ArgumentMatchers.<Date>any());
+        Mockito.verify(this.cookieStore, Mockito.times(1)).clearExpired(ArgumentMatchers.any());
     }
 
     @Test