@Test
public void legacyResponseHeaders() throws Exception {

    BaseHttpStack stack =
            new BaseHttpStack() {
                @Override
                public HttpResponse executeRequest(
                        Request<?> request, Map<String, String> additionalHeaders)
                        throws IOException, AuthFailureError {
                    assertSame(REQUEST, request);
                    assertSame(ADDITIONAL_HEADERS, additionalHeaders);
                    List<Header> headers = new ArrayList<>();
                    headers.add(new Header("HeaderA", "ValueA"));
                    headers.add(new Header("HeaderB", "ValueB_1"));
                    headers.add(new Header("HeaderB", "ValueB_2"));
                    return new HttpResponse(12345, headers);
                }
            };
    org.apache.http.HttpResponse resp = stack.performRequest(REQUEST, ADDITIONAL_HEADERS);
    assertEquals(12345, resp.getStatusLine().getStatusCode());
    assertEquals(3, resp.getAllHeaders().length);
    assertEquals("HeaderA", resp.getAllHeaders()[0].getName());
    assertEquals("ValueA", resp.getAllHeaders()[0].getValue());
    assertEquals("HeaderB", resp.getAllHeaders()[1].getName());
    assertEquals("ValueB_1", resp.getAllHeaders()[1].getValue());
    assertEquals("HeaderB", resp.getAllHeaders()[2].getName());
    assertEquals("ValueB_2", resp.getAllHeaders()[2].getValue());
    assertNull(resp.getEntity());
}