@Test public void testPseudoHeadersWithRemovePreservesPseudoIterationOrder() { Http2Headers headers = newHeaders(); Http2Headers nonPseudoHeaders = new DefaultHttp2Headers(); for (Entry<CharSequence, CharSequence> entry : headers) { if (entry.getKey().length() == 0 || entry.getKey().charAt(0) != ':' && !nonPseudoHeaders.contains(entry.getKey())) { nonPseudoHeaders.add(entry.getKey(), entry.getValue()); } } assertFalse(nonPseudoHeaders.isEmpty()); for (Entry<CharSequence, CharSequence> nonPseudoHeaderEntry : nonPseudoHeaders) { assertTrue(headers.remove(nonPseudoHeaderEntry.getKey())); verifyPseudoHeadersFirst(headers); verifyAllPseudoHeadersPresent(headers); } for (Entry<CharSequence, CharSequence> nonPseudoHeaderEntry : nonPseudoHeaders) { headers.add(nonPseudoHeaderEntry.getKey(), of("goo")); verifyPseudoHeadersFirst(headers); verifyAllPseudoHeadersPresent(headers); } }
@Override public boolean contains(CharSequence name, CharSequence value) { return contains(name, value, false); }
DefaultHttp2Headers extends DefaultHeaders<CharSequence, CharSequence, Http2Headers> implements Http2Headers { @Override public boolean contains(CharSequence name, CharSequence value) { return contains(name, value, false); } }
DefaultHttp2Headers extends DefaultHeaders<CharSequence, CharSequence, Http2Headers> implements Http2Headers { @Override public boolean contains(CharSequence name, CharSequence value) { return contains(name, value, false); } DefaultHttp2Headers(); @SuppressWarnings("unchecked")  DefaultHttp2Headers(boolean validate); @SuppressWarnings("unchecked")  DefaultHttp2Headers(boolean validate, int arraySizeHint); }
DefaultHttp2Headers extends DefaultHeaders<CharSequence, CharSequence, Http2Headers> implements Http2Headers { @Override public boolean contains(CharSequence name, CharSequence value) { return contains(name, value, false); } DefaultHttp2Headers(); @SuppressWarnings("unchecked")  DefaultHttp2Headers(boolean validate); @SuppressWarnings("unchecked")  DefaultHttp2Headers(boolean validate, int arraySizeHint); @Override Http2Headers clear(); @Override boolean equals(Object o); @Override int hashCode(); @Override Http2Headers method(CharSequence value); @Override Http2Headers scheme(CharSequence value); @Override Http2Headers authority(CharSequence value); @Override Http2Headers path(CharSequence value); @Override Http2Headers status(CharSequence value); @Override CharSequence method(); @Override CharSequence scheme(); @Override CharSequence authority(); @Override CharSequence path(); @Override CharSequence status(); @Override boolean contains(CharSequence name, CharSequence value); @Override boolean contains(CharSequence name, CharSequence value, boolean caseInsensitive); }
DefaultHttp2Headers extends DefaultHeaders<CharSequence, CharSequence, Http2Headers> implements Http2Headers { @Override public boolean contains(CharSequence name, CharSequence value) { return contains(name, value, false); } DefaultHttp2Headers(); @SuppressWarnings("unchecked")  DefaultHttp2Headers(boolean validate); @SuppressWarnings("unchecked")  DefaultHttp2Headers(boolean validate, int arraySizeHint); @Override Http2Headers clear(); @Override boolean equals(Object o); @Override int hashCode(); @Override Http2Headers method(CharSequence value); @Override Http2Headers scheme(CharSequence value); @Override Http2Headers authority(CharSequence value); @Override Http2Headers path(CharSequence value); @Override Http2Headers status(CharSequence value); @Override CharSequence method(); @Override CharSequence scheme(); @Override CharSequence authority(); @Override CharSequence path(); @Override CharSequence status(); @Override boolean contains(CharSequence name, CharSequence value); @Override boolean contains(CharSequence name, CharSequence value, boolean caseInsensitive);  }