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