private static int capacity(int expectedMaxSize){
  return (expectedMaxSize > MAXIMUM_CAPACITY / 3) ? MAXIMUM_CAPACITY : (expectedMaxSize <= 2 * MINIMUM_CAPACITY / 3) ? MINIMUM_CAPACITY : Integer.highestOneBit(expectedMaxSize + (expectedMaxSize << 1));
}

private static int capacity ( int expectedMaxSize ) { return ( expectedMaxSize > MAXIMUM_CAPACITY / 3 ) ? MAXIMUM_CAPACITY : ( expectedMaxSize <= 2 * MINIMUM_CAPACITY / 3 ) ? MINIMUM_CAPACITY : Integer . highestOneBit ( expectedMaxSize + ( expectedMaxSize << 1 ) ) ; }
returns the appropriate capacity for the given expected maximum size . returns the smallest power of two between minimum_capacity and maximum_capacity , inclusive , that is greater than ( 3 expectedmaxsize ) / 2 , if such a number exists . otherwise returns maximum_capacity .
