synchronized public Value addFirst(Transaction tx, Key key, Value value) throws IOException {
        assertLoaded();
        getHead(tx).addFirst(tx, key, value);
        size.incrementAndGet();
        flushCache();
        return null;
    }
@Test(timeout=60000)
    public void testAddFirst() throws Exception {
        createPageFileAndIndex(100);

        ListIndex<String, Long> listIndex = ((ListIndex<String, Long>) this.index);
        this.index.load(tx);
        tx.commit();

        tx = pf.tx();

        // put is add last
        doInsert(10);
        listIndex.addFirst(tx, key(10), (long) 10);
        listIndex.addFirst(tx, key(11), (long) 11);

        tx.commit();

        tx = pf.tx();
        int counter = 11;
        Iterator<Map.Entry<String, Long>> iterator = index.iterator(tx);
        assertEquals(key(counter), iterator.next().getKey());
        counter--;
        assertEquals(key(counter), iterator.next().getKey());
        counter--;
        int count = 0;
        while (iterator.hasNext() && count < counter) {
            Map.Entry<String, Long> entry = iterator.next();
            assertEquals(key(count), entry.getKey());
            assertEquals(count, (long) entry.getValue());
            count++;
        }
        tx.commit();
    }