Iterable<ChildNodeEntry> children = (Iterable<ChildNodeEntry>) store.getChildNodeEntries(indexState, true);
assertNotNull("The iterable cannot be null", children);
assertEquals("Expecting 3 items in the index", 3, Iterators.size(children.iterator()));
// ensuring the right sequence
ChildNodeEntry entry = null;
children = (Iterable<ChildNodeEntry>) store.getChildNodeEntries(indexState, true);
Iterator<ChildNodeEntry> it = children.iterator();
assertTrue("We should still have elements left to loop through", it.hasNext());
entry = it.next();
assertEquals("The first element should be :start", START, entry.getName());
assertEquals("Wrong entry returned", nodeStart, entry.getNodeState());
assertTrue("We should still have elements left to loop through", it.hasNext());
entry = it.next();
assertEquals("The second element should be n1", n1, entry.getName());
assertEquals("Wrong entry returned", node1, entry.getNodeState());
assertTrue("We should still have elements left to loop through", it.hasNext());
entry = it.next();
assertEquals("The third element should be n0", n0, entry.getName());
assertEquals("Wrong entry returned", node0, entry.getNodeState());
assertFalse("We should be at the end of the list", it.hasNext());
}