public void put(long key, int value) {
//        int index = insertKey( key );
        int index;
        {
            int hash = ((int) (key ^ (key >>> 32))) & 0x7fffffff;
            index = hash % set.length;
            long setKey = set[index];

            consumeFreeSlot = false;

            if (setKey == 0) {
                consumeFreeSlot = true;
//                insertKeyAt(index, key);
                set[index] = key;
            } else if (setKey == key) {
                index = -index - 1;   // already stored
            } else {
                // already FULL or REMOVED, must probe
//                index = insertKeyRehash(key, index, hash);
                {
                    // compute the double hash
                    final int length = set.length;
                    int probe = 1 + (hash % (length - 2));
                    final int loopIndex = index;

                    /**
                     * Look until FREE slot or we start to loop
                     */
                    do {
                        index -= probe;
                        if (index < 0) {
                            index += length;
                        }
                        setKey = set[index];

                        // A FREE slot stops the search
                        if (setKey == 0) {
                            consumeFreeSlot = true;
                            set[index] = key;  // insert value
                            break;
                        }

                        if (setKey == key) {
                            index = -index - 1;
                            break;
                        }

                        // Detect loop
                    } while (index != loopIndex);
                }
            }
        }

        boolean isNewMapping = true;
        if (index < 0) {
            index = -index - 1;
            isNewMapping = false;
        }
        values[index] = value;

        if (isNewMapping) {
            if (consumeFreeSlot) {
                free--;
            }

            // rehash whenever we exhaust the available space in the table
            if (++size > maxSize || free == 0) {
                // choose a new capacity suited to the new state of the table
                // if we've grown beyond our maximum size, double capacity;
                // if we've exhausted the free spots, rehash to the same capacity,
                // which will free up any stale removed slots for reuse.
                int capacity = set.length;
                int newCapacity = size > maxSize ? nextPrime(capacity << 1) : capacity;
//                rehash(newCapacity);
                {
                    int oldCapacity = set.length;

                    long[] oldKeys = set;
                    int[] oldVals = values;

                    set = new long[newCapacity];
                    values = new int[newCapacity];

                    for (int i = oldCapacity; i-- > 0; ) {
                        if (oldKeys[i] != 0) {
                            long o = oldKeys[i];
                            index = insertKey(o);
                            values[index] = oldVals[i];
                        }
                    }
                }

                capacity = set.length;
                // computeMaxSize(capacity);
                maxSize = Math.min(capacity - 1, (int) (capacity * 0.5f));
                free = capacity - size; // reset the free element count
            }
        }
    }
Creates a new <code>TLongIntHashMap</code> instance with the default
capacity and load factor.
core/src/main/java/com/alibaba/fastjson2/internal/trove/map/hash/TLongIntHashMap.java