HttpHeadersBase extends StringMultimap</* IN_NAME */ CharSequence, /* NAME */ AsciiString> implements HttpHeaderGetters { HttpMethod method() { final String methodStr = get(HttpHeaderNames.METHOD); checkState(methodStr != null, ":method header does not exist."); return HttpMethod.isSupported(methodStr) ? HttpMethod.valueOf(methodStr) : HttpMethod.UNKNOWN; } 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 testClearResetsPseudoHeaderDivision() { final HttpHeadersBase http2Headers = newHttp2Headers(); http2Headers.method(HttpMethod.POST); http2Headers.set("some", "value"); http2Headers.clear(); http2Headers.method(HttpMethod.GET); assertThat(http2Headers.names()).containsExactly(HttpHeaderNames.METHOD); assertThat(http2Headers.getAll(HttpHeaderNames.METHOD)).containsExactly("GET"); }