@Override
    public void releaseResources() {
        entityConsumer.releaseResources();
        final AsyncEntityProducer producer = entityProducerRef.getAndSet(null);
        if (producer != null) {
            producer.releaseResources();
        }
    }
A handler that echos the incoming request entity.
httpclient5-testing/src/main/java/org/apache/hc/client5/testing/async/AsyncEchoHandler.java