@Test
public void testLiteralWithIncrementalIndexingCompleteEviction() throws Http2Exception {

    // Verify indexed host header
    decode("4004" + hex("name") + "05" + hex("value"));
    verify(mockHeaders).add(of("name"), of("value"));
    verifyNoMoreInteractions(mockHeaders);
    reset(mockHeaders);
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < 4096; i++) {
        sb.append('a');
    }
    String value = sb.toString();
    sb = new StringBuilder();
    sb.append("417F811F");
    for (int i = 0; i < 4096; i++) {
        sb.append("61"); // 'a'
    }
    decode(sb.toString());
    verify(mockHeaders).add(of(":authority"), of(value));
    verifyNoMoreInteractions(mockHeaders);
    reset(mockHeaders);
    // Verify next header is inserted at index 62
    decode("4004" + hex("name") + "05" + hex("value") + "BE");
    verify(mockHeaders, times(2)).add(of("name"), of("value"));
    verifyNoMoreInteractions(mockHeaders);
}