public void loadPreemptively(final HttpHost host,
                                 final String pathPrefix,
                                 final AuthExchange authExchange,
                                 final HttpContext context) {
        if (authExchange.getState() == AuthExchange.State.UNCHALLENGED) {
            AuthScheme authScheme = loadFromCache(host, pathPrefix, HttpClientContext.cast(context));
            if (authScheme == null && pathPrefix != null) {
                authScheme = loadFromCache(host, null, HttpClientContext.cast(context));
            }
            if (authScheme != null) {
                authExchange.select(authScheme);
            }
        }
    }
Utility class that implements commons aspects of the client side authentication cache keeping.

@since 5.2
httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/AuthCacheKeeper.java