@Test(timeout=60000)
public void testSize() throws Exception {

    createPageFileAndIndex(100);
    ListIndex<String, Long> listIndex = ((ListIndex<String, Long>) this.index);
    this.index.load(tx);
    tx.commit();
    int count = 30;
    tx = pf.tx();
    doInsert(count);
    tx.commit();
    assertEquals("correct size", count, listIndex.size());
    tx = pf.tx();
    Iterator<Map.Entry<String, Long>> iterator = index.iterator(tx);
    while (iterator.hasNext()) {
        iterator.next();
        iterator.remove();
        assertEquals("correct size", --count, listIndex.size());
    }
    tx.commit();
    count = 30;
    tx = pf.tx();
    doInsert(count);
    tx.commit();
    assertEquals("correct size", count, listIndex.size());
    tx = pf.tx();
    listIndex.clear(tx);
    assertEquals("correct size", 0, listIndex.size());
    tx.commit();
}