### Question:
AbstractS3ResponseHandler implements HttpResponseHandler<AmazonWebServiceResponse<T>> { protected AmazonWebServiceResponse<T> parseResponseMetadata(HttpResponse response) { final AmazonWebServiceResponse<T> awsResponse = new AmazonWebServiceResponse<T>(); final String awsRequestId = response.getHeaders().get(Headers.REQUEST_ID); final String hostId = response.getHeaders().get(Headers.EXTENDED_REQUEST_ID); final String cloudFrontId = response.getHeaders().get(Headers.CLOUD_FRONT_ID); final Map<String, String> metadataMap = new HashMap<String, String>(); metadataMap.put(ResponseMetadata.AWS_REQUEST_ID, awsRequestId); metadataMap.put(S3ResponseMetadata.HOST_ID, hostId); metadataMap.put(S3ResponseMetadata.CLOUD_FRONT_ID, cloudFrontId); awsResponse.setResponseMetadata(new S3ResponseMetadata(metadataMap)); return awsResponse; }  @Override boolean needsConnectionLeftOpen();  }### Answer:
@Test public void testParseResponseMetadata() { HttpResponse response = new HttpResponse.Builder() .header(Headers.REQUEST_ID, "testId") .header(Headers.EXTENDED_REQUEST_ID, "extendedId") .build(); TClass handler = new TClass(); AmazonWebServiceResponse<String> result = handler.parseResponseMetadata(response); assertEquals(result.getResponseMetadata().getRequestId(), "testId"); assertEquals(((S3ResponseMetadata) result.getResponseMetadata()).getHostId(), "extendedId"); }