code: private void rehash() {
          int oldCapacity = mTable.length;
          Entry oldSet[] = mTable;
  
          int newCapacity = oldCapacity * 2 + 1;
          Entry newSet[] = new Entry[newCapacity];
  
          mModCount++;
          mThreshold = (int)(newCapacity * mLoadFactor);
          mTable = newSet;
  
          for (int i = oldCapacity ; i-- > 0 ;) {
              for (Entry old = oldSet[i] ; old != null ; ) {
                  Entry e = old;
                  old = old.mNext;
  
                  // Only copy entry if its value hasn't been cleared.
                  if (e.get() == null) {
                      mCount--;
                  }
                  else {
                      int index = (e.mHash & 0x7FFFFFFF) % newCapacity;
                      e.mNext = newSet[index];
                      newSet[index] = e;
                  }
              }
          }
      }
docs: Rehashes the contents of this map into a new <tt>HashMap</tt> instance
  with a larger capacity. This method is called automatically when the
  number of keys in this map exceeds its capacity and load factor.