### Question:
ResponseHeaderHandlerChain extends S3XmlResponseHandler<T> { public ResponseHeaderHandlerChain(Unmarshaller<T, InputStream> responseUnmarshaller, HeaderHandler<T>... headerHandlers) { super(responseUnmarshaller); this.headerHandlers = Arrays.asList(headerHandlers); } ResponseHeaderHandlerChain(Unmarshaller<T, InputStream> responseUnmarshaller,
            HeaderHandler<T>... headerHandlers); @Override AmazonWebServiceResponse<T> handle(HttpResponse response);  }### Answer:
@Test public void testResponseHeaderHandlerChain() throws Exception { final List<Boolean> called = new ArrayList<Boolean>(); final HttpResponse testResponse = new HttpResponse.Builder().build(); @SuppressWarnings("unchecked") ResponseHeaderHandlerChain<AmazonWebServiceResponse<String>> chain = new ResponseHeaderHandlerChain<AmazonWebServiceResponse<String>>( new Unmarshaller<AmazonWebServiceResponse<String>, InputStream>() { @Override public AmazonWebServiceResponse<String> unmarshall(InputStream in) throws Exception { called.add(true); return new AmazonWebServiceResponse<String>(); } }, new HeaderHandler<AmazonWebServiceResponse<String>>() { @Override public void handle(AmazonWebServiceResponse<String> result, HttpResponse response) { assertSame(response, testResponse); called.add(true); } }, new HeaderHandler<AmazonWebServiceResponse<String>>() { @Override public void handle(AmazonWebServiceResponse<String> result, HttpResponse response) { assertSame(response, testResponse); called.add(true); } }); chain.handle(testResponse); assertEquals(called.size(), 3); assertTrue(called.get(0)); assertTrue(called.get(1)); assertTrue(called.get(2)); }