### Question:
AmazonHttpClient { <T> void afterResponse(Request<?> request, List<RequestHandler2> requestHandler2s, Response<T> response, TimingInfo timingInfo) { for (final RequestHandler2 handler2 : requestHandler2s) { handler2.afterResponse(request, response); } } AmazonHttpClient(ClientConfiguration config); @Deprecated  AmazonHttpClient(ClientConfiguration config,
            RequestMetricCollector requestMetricCollector);  AmazonHttpClient(ClientConfiguration config, HttpClient httpClient); @Deprecated  AmazonHttpClient(ClientConfiguration config, HttpClient httpClient,
            RequestMetricCollector requestMetricCollector); @Deprecated ResponseMetadata getResponseMetadataForRequest(AmazonWebServiceRequest request); Response<T> execute(Request<?> request,
            HttpResponseHandler<AmazonWebServiceResponse<T>> responseHandler,
            HttpResponseHandler<AmazonServiceException> errorResponseHandler,
            ExecutionContext executionContext); void shutdown(); RequestMetricCollector getRequestMetricCollector();  }### Answer:
@Test public void testAfterResponse() { final Request<?> testRequest = new DefaultRequest<String>("test"); final Response<?> testResponse = new Response<String>("test", new HttpResponse.Builder().build()); final List<Object> calls = new ArrayList<Object>(); List<RequestHandler2> handlers = new ArrayList<RequestHandler2>(); RequestHandler2 handler = new RequestHandler2() { @Override public void beforeRequest(Request<?> request) { } @Override public void afterResponse(Request<?> request, Response<?> response) { assertSame(testRequest, request); assertSame(testResponse, response); calls.add(this); } @Override public void afterError(Request<?> request, Response<?> response, Exception e) { } }; handlers.add(handler); client.afterResponse(testRequest, handlers, testResponse, null); assertEquals(calls.size(), 1); assertTrue(calls.contains(handler)); }