@VisibleForTesting
    static int capacity(int expectedSize) {
        if (expectedSize < 3) {
            checkNonnegative(expectedSize, "expectedSize");
            return expectedSize + 1;
        }
        if (expectedSize < MAX_POWER_OF_TWO) {
            return expectedSize + expectedSize / 3;
        }
        return Integer.MAX_VALUE; // any large value
    }
@ VisibleForTesting static int capacity ( int expectedSize ) { if ( expectedSize < 3 ) { checkNonnegative ( expectedSize , "expectedSize" ) ; return expectedSize + 1 ; } if ( expectedSize < MAX_POWER_OF_TWO ) { return expectedSize + expectedSize / 3 ; } return Integer . MAX_VALUE ; }
Returns a capacity that is sufficient to keep the map from being resized
as long as it grows no larger than expectedSize and the load factor is >=
its default (0.75).