@Test
  public void testHeader() throws IOException {
    wrapper.setStatus(200);
    verify(response).setStatus(200);
    wrapper.addHeader("header", "header value");
    verify(response).addHeader("header", "header value");
    wrapper.addHeader("content-length", "header value2");
    verify(response, never()).addHeader("content-length", "header value");

    wrapper.setIntHeader("header", 5);
    verify(response).setIntHeader("header", 5);
    wrapper.setIntHeader("content-length", 4);
    verify(response, never()).setIntHeader("content-length", 4);

    wrapper.setHeader("set-header", "new value");
    verify(response).setHeader("set-header", "new value");
    wrapper.setHeader("content-length", "content length value");
    verify(response, never()).setHeader("content-length", "content length value");

    wrapper.sendRedirect("location");
    verify(response).sendRedirect("location");

    wrapper.flushBuffer();
    verify(response).flushBuffer();
  }
wrapper should set all headers except "content-length"
hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/TestGZIPResponseWrapper.java