code: @SuppressWarnings("unchecked")
    private void resize(int cap) {
      int newCapacity = computeCapacity(cap);
      if (newCapacity == this.capacity) {
        return;
      }
      this.capacity = newCapacity;
      this.expandThreshold = (int) (capacity * maxLoadFactor);
      this.shrinkThreshold = (int) (capacity * minLoadFactor);
      this.hash_mask = capacity - 1;
      LinkedElement<T>[] temp = entries;
      entries = new LinkedElement[capacity];
      for (int i = 0; i < temp.length; i++) {
        LinkedElement<T> curr = temp[i];
        while (curr != null) {
          LinkedElement<T> next = curr.next;
          int index = getIndex(curr.hashCode);
          curr.next = entries[index];
          entries[index] = curr;
          curr = next;
        }
      }
    }
docs: Resize the internal table to given capacity.