question: private T [ ] ensureCapacity ( int minCapacity ) { if ( tmp . length < minCapacity ) { int newSize = minCapacity ; newSize |= newSize > > 1 ; newSize |= newSize > > 2 ; newSize |= newSize > > 4 ; newSize |= newSize > > 8 ; newSize |= newSize > > 16 ; newSize ++ ; if ( newSize < 0 ) newSize = minCapacity ; else newSize = Math . min ( newSize , a . length > > > 1 ) ; T [ ] newArray = ( T [ ] ) new Object [ newSize ] ; tmp = newArray ; } return tmp ; }
target:  Ensures that the external array tmp has at least the specified number of elements, increasing its size if necessary. The size increases exponentially to ensure amortized linear time complexity.