code: private void resize() {
          final Entry[] old = table;
          table = new Entry[old.length * 2];
  
          for (int i = 0; i < old.length; i++) {
              Entry next = old[i];
              while (next != null) {
                  final Entry entry = next;
                  next = next.next;
                  final int index = indexFor(entry.hash);
                  entry.next = table[index];
                  table[index] = entry;
              }
              old[i] = null;
          }
          threshold = (int) (table.length * loadFactor);
      }
docs: Resizes this hash table by doubling its capacity. This is an expensive operation, as entries must be copied from the old smaller
  table to the new bigger table.