code: protected Record<V> removeImpl (int key, boolean checkShrink)
      {
          int index = keyToIndex(key);
  
          // go through the chain looking for a match
          for (Record<V> prev = null, rec = _buckets[index]; rec != null; rec = rec.next) {
              if (rec.key == key) {
                  if (prev == null) {
                      _buckets[index] = rec.next;
                  } else {
                      prev.next = rec.next;
                  }
                  _size--;
                  if (checkShrink) {
                      checkShrink();
                  }
                  return rec;
              }
              prev = rec;
          }
  
          return null;
      }
docs: Remove an element with optional checking to see if we should shrink.
  When this is called from our iterator, checkShrink==false to avoid booching the buckets.