public V put(final long key, final V value) {
        final Entry<V>[] table = this.table;
        final int index = HashUtil.indexFor(key, table.length, mask);

        for (Entry<V> e = table[index]; e != null; e = e.hashNext) {
            if (e.key == key) {
                moveToTop(e);
                return e.setValue(value);
            }
        }

        final Entry<V> e = new Entry<>(key, value);
        e.hashNext = table[index];
        table[index] = e;
        final Entry<V> top = this.top;
        e.next = top;
        if (top != null) {
            top.previous = e;
        } else {
            back = e;
        }
        this.top = e;
        _size += 1;

        if (removeEldestEntry(back)) {
            remove(back.key);
        } else if (_size > capacity) {
            rehash(HashUtil.nextCapacity(capacity));
        }
        return null;
    }
@Test
    public void keySet() {
        final LongLinkedHashMap<String> tested = new LongLinkedHashMap<>();
        for (long i = 0; i < 10000; ++i) {
            tested.put(i, Long.toString(i));
        }
        long i = 10000;
        for (Long key : tested.keySet()) {
            Assert.assertEquals(--i, key.longValue());
        }
    }