final T baseGet(Object key) {
        int slot = findSlot(key, elements.length);
        Object value = elements[slot];
        if (value == null) {
            return null;
        } else if (value instanceof Object[]) {
            T[] array = (T[]) value;
            for (T object : array) {
                if (object.equals(key)) {
                    return object;
                }
            }
            return null;
        } else if (value.equals(key)) {
            return (T) value;
        } else {
            return null;
        }
    }
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