hollow/src/main/java/com/netflix/hollow/core/memory/encoding/HashCodes.java
public static int hashTableSize(int numElements) throws IllegalArgumentException {
        if (numElements < 0) {
            throw new IllegalArgumentException("cannot be negative; numElements="+numElements);
        } else if (numElements > HASH_TABLE_MAX_SIZE) {
            throw new IllegalArgumentException("exceeds maximum number of buckets; numElements="+numElements);
        }

        if (numElements == 0)
            return 1;
        if (numElements < 3)
            return numElements * 2;

        // Apply load factor to number of elements and determine next
        // largest power of 2 that fits in an int
        int sizeAfterLoadFactor = (int)((long)numElements * 10 / 7);
        int bits = 32 - Integer.numberOfLeadingZeros(sizeAfterLoadFactor - 1);
        return 1 << bits;
    }
public static int hashTableSize(int numElements) throws IllegalArgumentException {
        if (numElements < 0) {
            throw new IllegalArgumentException("cannot be negative; numElements="+numElements);
        } else if (numElements > HASH_TABLE_MAX_SIZE) {
            throw new IllegalArgumentException("exceeds maximum number of buckets; numElements="+numElements);
        }

        if (numElements == 0)
            return 1;
        if (numElements < 3)
            return numElements * 2;

        // Apply load factor to number of elements and determine next
        // largest power of 2 that fits in an int
        int sizeAfterLoadFactor = (int)((long)numElements * 10 / 7);
        int bits = 32 - Integer.numberOfLeadingZeros(sizeAfterLoadFactor - 1);
        return 1 << bits;
    }
Determine size of hash table capable of storing the specified number of elements with a load
factor applied.

@param numElements number of elements to be stored in the table
@return size of hash table, always a power of 2
@throws IllegalArgumentException when numElements is negative or exceeds
{@link com.netflix.hollow.core.HollowConstants#HASH_TABLE_MAX_SIZE}