FlatFileBufferLinkedList implements NodeStateEntryList { @Override public int size() { return size; } FlatFileBufferLinkedList();  FlatFileBufferLinkedList(long memLimit); void add(@NotNull NodeStateEntry item); NodeStateEntry remove(); @Override Iterator<NodeStateEntry> iterator(); @Override int size(); @Override boolean isEmpty(); @Override long estimatedMemoryUsage(); @Override void close();  }
@Test public void size() { assertEquals("empty list must be 0-sized", 0, list.size()); list.add(testNode("/")); assertEquals("single entry list must be 1-sized", 1, list.size()); assertEquals("single entry list must be 1-sized on separate iterators", 1, list.size()); list.add(testNode("/")); assertEquals("2 entries in list must be 2-sized", 2, list.size()); assertEquals("2 entries in list must be 2-sized on separate iterators", 2, list.size()); list.remove(); assertEquals("2 entries in list must be 1-sized after removing an item", 1, list.size()); }