HeaderGroup implements MessageHeaders, Serializable { public void clear() { headers.clear(); } HeaderGroup(); void clear(); void addHeader(final Header header); boolean removeHeader(final Header header); boolean removeHeaders(final Header header); void setHeader(final Header header); void setHeaders(final Header... headers); Header getCondensedHeader(final String name); @Override Header[] getHeaders(final String name); @Override Header getFirstHeader(final String name); @Override Header getHeader(final String name); @Override Header getLastHeader(final String name); @Override Header[] getHeaders(); @Override boolean containsHeader(final String name); @Override int countHeaders(final String name); @Override Iterator<Header> headerIterator(); @Override Iterator<Header> headerIterator(final String name); boolean removeHeaders(final String name); @Override String toString();  }
@Test public void testClear() { final HeaderGroup headergroup = new HeaderGroup(); headergroup.addHeader(new BasicHeader("name", "value")); Assert.assertEquals(1, headergroup.getHeaders().length); headergroup.clear(); Assert.assertEquals(0, headergroup.getHeaders().length); }