code: public int length() {
      int length;
      if (head < tail) {
        length = headerFields.length - tail + head;
      } else {
        length = head - tail;
      }
      return length;
    }
docs: Return the number of header fields in the dynamic table.