public int length() {
        int length;
        if (head < tail) {
            length = hpackHeaderFields.length - tail + head;
        } else {
            length = head - tail;
        }
        return length;
    }
@Test
    public void testLength() {
        HpackDynamicTable table = new HpackDynamicTable(100);
        assertEquals(0, table.length());
        HpackHeaderField entry = new HpackHeaderField(FOO, BAR);
        table.add(entry);
        assertEquals(1, table.length());
        table.clear();
        assertEquals(0, table.length());
    }