code: private void add(CharSequence name, CharSequence value, long headerSize) {
          // Clear the table if the header field size is larger than the maxHeaderTableSize.
          if (headerSize > maxHeaderTableSize) {
              clear();
              return;
          }
  
          // Evict oldest entries until we have enough maxHeaderTableSize.
          while (maxHeaderTableSize - size < headerSize) {
              remove();
          }
  
          int h = AsciiString.hashCode(name);
          int i = index(h);
          HeaderEntry old = headerFields[i];
          HeaderEntry e = new HeaderEntry(h, name, value, head.before.index - 1, old);
          headerFields[i] = e;
          e.addBefore(head);
          size += headerSize;
      }
docs: Add the header field to the dynamic table. Entries are evicted from the dynamic table until
  the size of the table and the new header field is less than the table's maxHeaderTableSize. If the size
  of the new entry is larger than the table's maxHeaderTableSize, the dynamic table will be cleared.