question: protected void rehash ( ) { int oldCapacity = table . length ; Entry oldMap [ ] = table ; int newCapacity = oldCapacity * 2 + 1 ; if ( newCapacity > maxSize ) { newCapacity = maxSize ; threshold = newCapacity ; } else { threshold = ( int ) ( newCapacity * loadFactor ) ; } Entry newMap [ ] = new Entry [ newCapacity ] ; modCount ++ ; table = newMap ; for ( int i = oldCapacity ; i -- > 0 ; ) { for ( Entry old = oldMap [ i ] ; old != null ; ) { Entry e = old ; old = old . next ; int index = ( e . hash & 0x7FFFFFFF ) % newCapacity ; e . next = newMap [ index ] ; newMap [ index ] = e ; } } }
target:  Increases the capacity of and internally reorganizes this Cache, in order to accommodate and access its entries more efficiently. This method is called automatically when the number of keys in the Cache exceeds this Cache's capacity and load factor. It ensures the new capacity does not exceed the maximum size.