@Test
  public void testResponse() {
    Response response = new Response(200);
    assertEquals(200, response.getCode());
    Header[] headers = new Header[2];
    headers[0] = new BasicHeader("header1", "value1");
    headers[1] = new BasicHeader("header2", "value2");
    response = new Response(200, headers);
    assertEquals("value1", response.getHeader("header1"));
    assertFalse(response.hasBody());
    response.setCode(404);
    assertEquals(404, response.getCode());
    headers = new Header[2];
    headers[0] = new BasicHeader("header1", "value1.1");
    headers[1] = new BasicHeader("header2", "value2");
    response.setHeaders(headers);
    assertEquals("value1.1", response.getHeader("header1"));
    response.setBody(Bytes.toBytes("body"));
    assertTrue(response.hasBody());
  }
Test a some methods of class Response.
hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java