@Override
                public void completed(final byte[] content) {
                    final BasicAsyncEntityProducer entityProducer = new BasicAsyncEntityProducer(content, contentType);
                    entityProducerRef.set(entityProducer);
                    try {
                        responseChannel.sendResponse(new BasicHttpResponse(HttpStatus.SC_OK), entityProducer, context);
                    } catch (final IOException | HttpException ex) {
                        failed(ex);
                    }
                }
A handler that echos the incoming request entity.
httpclient5-testing/src/main/java/org/apache/hc/client5/testing/async/AsyncEchoHandler.java