static int expectedSizeToCapacity(int expectedSize) {
        long minCapacity = (long) Math.ceil((float) expectedSize / MAX_LOAD_FACTOR);
        return Math.max(MIN_CAPACITY,
                (int) Math.min(MAX_CAPACITY, roundUpToPowerOfTwo(minCapacity)));
    }
Calculate the capacity we should provision, given the expected size.
<br>
Our capacity must always be a power of 2, and never less than 2 or more
than MAX_CAPACITY.  We use 64-bit numbers here to avoid overflow
concerns.
server-common/src/main/java/org/apache/kafka/timeline/BaseHashTable.java