@Override
    public V getAndRemove(K name) {
        int h = hashingStrategy.hashCode(name);
        return remove0(h, index(h), checkNotNull(name, "name"));
    }
@Test
    public void testGetAndRemove() {
        TestDefaultHeaders headers = newInstance();
        headers.add(of("name1"), of("value1"));
        headers.add(of("name2"), of("value2"), of("value3"));
        headers.add(of("name3"), of("value4"), of("value5"), of("value6"));

        assertEquals(of("value1"), headers.getAndRemove(of("name1"), of("defaultvalue")));
        assertEquals(of("value2"), headers.getAndRemove(of("name2")));
        assertNull(headers.getAndRemove(of("name2")));
        assertEquals(asList(of("value4"), of("value5"), of("value6")), headers.getAllAndRemove(of("name3")));
        assertEquals(0, headers.size());
        assertNull(headers.getAndRemove(of("noname")));
        assertEquals(of("defaultvalue"), headers.getAndRemove(of("noname"), of("defaultvalue")));
    }