code: public void add(HpackHeaderField header) {
          int headerSize = header.size();
          if (headerSize > capacity) {
              clear();
              return;
          }
          while (capacity - size < headerSize) {
              remove();
          }
          hpackHeaderFields[head++] = header;
          size += header.size();
          if (head == hpackHeaderFields.length) {
              head = 0;
          }
      }
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 or equal to the table's capacity.
  If the size of the new entry is larger than the table's capacity, the dynamic table will be
  cleared.