@Test
    void testHttpEntityWriteToForDeflate() throws Exception {
        final String entityText = "Hello, this is some plain text coming back.";

        configureServer(bootstrap -> bootstrap
                .register("*", createDeflateEncodingRequestHandler(entityText, true)));

        final HttpHost target = startServer();

        final TestClient client = client();

        final HttpGet request = new HttpGet("/some-resource");
        client.execute(target, request, response -> {
            final ByteArrayOutputStream out = new ByteArrayOutputStream();
            response.getEntity().writeTo(out);
            Assertions.assertEquals(entityText, out.toString("utf-8"));
            return out;
        });
    }
Try with a bunch of client threads, to check that it's thread-safe.

@throws Exception
            if there was a problem
httpclient5-testing/src/test/java/org/apache/hc/client5/testing/sync/TestContentCodings.java