public int putIfAbsent(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 loopIndex = index;

                    /**
                     * Look until FREE slot or we start to loop
                     */
                    do {
//                        int probe = 1 + (hash % (set.length - 2));
//                        index -= (probe);
                        index -= (1 + (hash % (set.length - 2)));
                        if (index < 0) {
                            index += set.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);
                }
            }
        }

        if (index < 0) {
            return values[-index - 1];
        }

        values[index] = value;

        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;
//                rehash(newCapacity);
            rehash(capacity);

            capacity = set.length;
            // computeMaxSize(capacity);
            maxSize = Math.min(capacity - 1, (int) (capacity * 0.5f));
            free = capacity - size; // reset the free element count
        }

        return value;
    }
Look until FREE slot or we start to loop
core/src/main/java/com/alibaba/fastjson2/internal/trove/map/hash/TLongIntHashMap.java