@Override
                            protected void customizeUnauthorizedResponse(final ClassicHttpResponse unauthorized) {
                                unauthorized.addHeader(HttpHeaders.WWW_AUTHENTICATE, StandardAuthScheme.DIGEST + " realm=\"test realm\" invalid");
                            }
Unit tests for automatic client authentication.
httpclient5-testing/src/test/java/org/apache/hc/client5/testing/sync/TestClientAuthentication.java