code: @Test public void testBasicHeaderOps(){
    HttpMessage message=new TestHttpMessage();
    Assert.assertFalse(message.containsHeader("whatever"));
    message.addHeader("name","1");
    message.addHeader("name","2");
    Header[] headers=message.getAllHeaders();
    Assert.assertNotNull(headers);
    Assert.assertEquals(2,headers.length);
    Header h=message.getFirstHeader("name");
    Assert.assertNotNull(h);
    Assert.assertEquals("1",h.getValue());
    message.setHeader("name","3");
    h=message.getFirstHeader("name");
    Assert.assertNotNull(h);
    Assert.assertEquals("3",h.getValue());
    h=message.getLastHeader("name");
    Assert.assertNotNull(h);
    Assert.assertEquals("2",h.getValue());
    message.addHeader(null);
    message.setHeader(null);
    headers=message.getHeaders("name");
    Assert.assertNotNull(headers);
    Assert.assertEquals(2,headers.length);
    Assert.assertEquals("3",headers[0].getValue());
    Assert.assertEquals("2",headers[1].getValue());
    message.addHeader("name","4");
    headers[1]=new BasicHeader("name","5");
    message.setHeaders(headers);
    headers=message.getHeaders("name");
    Assert.assertNotNull(headers);
    Assert.assertEquals(2,headers.length);
    Assert.assertEquals("3",headers[0].getValue());
    Assert.assertEquals("5",headers[1].getValue());
    message.setHeader("whatever",null);
    message.removeHeaders("name");
    message.removeHeaders(null);
    headers=message.getAllHeaders();
    Assert.assertNotNull(headers);
    Assert.assertEquals(1,headers.length);
    Assert.assertEquals(null,headers[0].getValue());
    message.removeHeader(message.getFirstHeader("whatever"));
    headers=message.getAllHeaders();
    Assert.assertNotNull(headers);
    Assert.assertEquals(0,headers.length);
  }
  