@Test
  public void testModifyRequestHeader() throws Exception {
    localTestServer.register("/targetPath*", new RequestInfoHandler() {
      public void handle(HttpRequest request, HttpResponse response, HttpContext context) throws HttpException, IOException {
        Header headerToTest = request.getFirstHeader(ModifyHeadersProxyServlet.REQUEST_HEADER);
        assertEquals("REQUEST_VALUE_MODIFIED", headerToTest.getValue());

        super.handle(request, response, context);
      }
    });

    GetMethodWebRequest req = makeGetMethodRequest(sourceBaseUri);
    req.setHeaderField(ModifyHeadersProxyServlet.REQUEST_HEADER, "INITIAL_VALUE");

    execAndAssert(req, "");
  }
tests to show that by extending ProxyServlet we can override methods coping headers to proxied response and from it
src/test/java/org/mitre/dsmiley/httpproxy/ModifyHeadersProxyServletTest.java