HttpHeadersBase extends StringMultimap</* IN_NAME */ CharSequence, /* NAME */ AsciiString> implements HttpHeaderGetters { @Nullable String authority() { final String authority = get(HttpHeaderNames.AUTHORITY); return authority != null ? authority : get(HttpHeaderNames.HOST); } HttpHeadersBase(int sizeHint);   HttpHeadersBase(HttpHeadersBase parent, boolean shallowCopy);   HttpHeadersBase(HttpHeaderGetters parent); @Nullable @Override MediaType contentType(); @Override final boolean isEndOfStream(); @Override final int hashCode(); @Override boolean equals(@Nullable Object o); @Override final String toString();  }
@Test void testSetOrdersPseudoHeadersCorrectly() { final HttpHeadersBase headers = newHttp2Headers(); final HttpHeadersBase other = newEmptyHeaders(); other.add("name2", "value2"); other.add("name3", "value3"); other.add("name4", "value4"); other.authority("foo"); final int headersSizeBefore = headers.size(); headers.set(other); verifyPseudoHeadersFirst(headers); verifyAllPseudoHeadersPresent(headers); assertThat(headers.size()).isEqualTo(headersSizeBefore + 1); assertThat(headers.authority()).isEqualTo("foo"); assertThat(headers.get("name2")).isEqualTo("value2"); assertThat(headers.get("name3")).isEqualTo("value3"); assertThat(headers.get("name4")).isEqualTo("value4"); }