@Test
public void testResponseIsClosed() throws IOException {

    Object result = new Object();
    Response response = createResponseMock();
    CompletableFuture<Object> future = new CompletableFuture<>();
    ResponseProcessor<Object> processor = createProcessorMock();
    when(processor.process(any())).thenReturn(result);
    Callback callback = httpClient.createCallback(processor, future);
    callback.onResponse(createCallMock(), response);
    assertThat(future.join()).isEqualTo(result);
    verify(response).close();
}