@Test public void testAdd() { Headers headers = new RecordHeaders(); headers.add(new RecordHeader("key", "value".getBytes())); Header header = headers.iterator().next(); assertHeader("key", "value", header); headers.add(new RecordHeader("key2", "value2".getBytes())); assertHeader("key2", "value2", headers.lastHeader("key2")); assertEquals(2, getCount(headers)); }
@Override public Headers add(Header header) throws IllegalStateException { canWrite(); headers.add(header); return this; }
RecordHeaders implements Headers { @Override public Headers add(Header header) throws IllegalStateException { canWrite(); headers.add(header); return this; } }
RecordHeaders implements Headers { @Override public Headers add(Header header) throws IllegalStateException { canWrite(); headers.add(header); return this; } RecordHeaders();  RecordHeaders(Header[] headers);  RecordHeaders(Iterable<Header> headers); }
RecordHeaders implements Headers { @Override public Headers add(Header header) throws IllegalStateException { canWrite(); headers.add(header); return this; } RecordHeaders();  RecordHeaders(Header[] headers);  RecordHeaders(Iterable<Header> headers); @Override Headers add(Header header); @Override Headers add(String key, byte[] value); @Override Headers remove(String key); @Override Header lastHeader(String key); @Override Iterable<Header> headers(final String key); @Override Iterator<Header> iterator(); void setReadOnly(); Header[] toArray(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
RecordHeaders implements Headers { @Override public Headers add(Header header) throws IllegalStateException { canWrite(); headers.add(header); return this; } RecordHeaders();  RecordHeaders(Header[] headers);  RecordHeaders(Iterable<Header> headers); @Override Headers add(Header header); @Override Headers add(String key, byte[] value); @Override Headers remove(String key); @Override Header lastHeader(String key); @Override Iterable<Header> headers(final String key); @Override Iterator<Header> iterator(); void setReadOnly(); Header[] toArray(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }