public boolean removeIf(Predicate<? super Map.Entry<HeaderName, String>> filter) {
        Objects.requireNonNull(filter, "filter");
        boolean removed = false;
        int w = 0;
        for (int r = 0; r < size(); r++) {
            if (filter.test(new SimpleImmutableEntry<>(new HeaderName(originalName(r), name(r)), value(r)))) {
                removed = true;
            } else {
                originalName(w, originalName(r));
                name(w, name(r));
                value(w, value(r));
                w++;
            }
        }
        truncate(w);
        return removed;
    }
@Test
    void removeIf() {
        Headers headers = new Headers();
        headers.add("Via", "duct");
        headers.add("Cookie", "this=that");
        headers.add("COOkie", "frizzle=frazzle");
        headers.add("Soup", "salad");

        boolean removed = headers.removeIf(entry -> entry.getKey().getName().equals("Cookie"));

        assertTrue(removed);
        Truth.assertThat(headers.getAll("cOoKie")).containsExactly("frizzle=frazzle");
        Truth.assertThat(headers.size()).isEqualTo(3);
    }