code: protected int findBucketWithAutoGrowth(
        final ByteBuffer keyBuffer,
        final int keyHash
    )
    {
      int bucket = findBucket(canAllowNewBucket(), maxBuckets, tableBuffer, keyBuffer, keyHash);
  
      if (bucket < 0) {
        if (size < maxSizeForTesting) {
          adjustTableWhenFull();
          bucket = findBucket(size < regrowthThreshold, maxBuckets, tableBuffer, keyBuffer, keyHash);
        }
      }
  
      return bucket;
    }
docs: Find a bucket for a key, attempting to resize the table with adjustTableWhenFull() if possible.
  
  @param keyBuffer buffer containing the key
  @param keyHash hash of the key
  @return bucket number of the found bucket or -1 if a bucket could not be allocated after resizing.