static int findSlot(Object object, int numElements) {
        // This performs a secondary hash using Knuth's multiplicative Fibonacci
        // hashing.  Then, we choose some of the highest bits.  The number of bits
        // we choose is based on the table size.  If the size is 2, we need 1 bit;
        // if the size is 4, we need 2 bits, etc.
        int objectHashCode = object.hashCode();
        int log2size = 32 - Integer.numberOfLeadingZeros(numElements);
        int shift = 65 - log2size;
        return (int) ((objectHashCode * -7046029254386353131L) >>> shift);
    }
@Test
    public void testFindSlot() {
        Random random = new Random(123);
        for (int i = 1; i <= 5; i++) {
            int numSlots = 2 << i;
            HashSet<Integer> slotsReturned = new HashSet<>();
            while (slotsReturned.size() < numSlots) {
                int slot = BaseHashTable.findSlot(random.nextInt(), numSlots);
                assertTrue(slot >= 0);
                assertTrue(slot < numSlots);
                slotsReturned.add(slot);
            }
        }
    }