public int put(final int key, final int value)
    {
        final int missingValue = this.missingValue;
        if (missingValue == value)
        {
            throw new IllegalArgumentException("cannot accept missingValue");
        }

        final int[] entries = this.entries;
        @DoNotSub final int mask = entries.length - 1;
        @DoNotSub int index = Hashing.evenHash(key, mask);

        int oldValue;
        while (missingValue != (oldValue = entries[index + 1]))
        {
            if (key == entries[index])
            {
                break;
            }

            index = next(index, mask);
        }

        if (missingValue == oldValue)
        {
            ++size;
            entries[index] = key;
        }

        entries[index + 1] = value;

        increaseCapacity();

        return oldValue;
    }
@Test
    void shouldCopyConstructAndBeEqual()
    {
        final int[] testEntries = { 3, 1, 19, 7, 11, 12, 7 };

        final Int2IntHashMap map = new Int2IntHashMap(Integer.MIN_VALUE);
        for (final int testEntry : testEntries)
        {
            map.put(testEntry, testEntry + 1);
        }

        final Int2IntHashMap mapCopy = new Int2IntHashMap(map);
        assertEquals(map, mapCopy);
    }