final List<Div> divs = collectNodes(nodes, Div.class);
assertEquals("Wrong number of divs returned from node query", 4, divs.size());
// check first div, should have no siblings and one child
final Div firstDiv = divs.get(0);
assertEquals("Wrong number of children", 1, firstDiv.getChildRelationships().size());
assertNull("Node should not have siblings", firstDiv.getNextSibling());
// check second div, should have no siblings and two children
final Div secondDiv = divs.get(1);
assertEquals("Wrong number of children", 2, secondDiv.getChildRelationships().size());
assertNull("Node should not have siblings", secondDiv.getNextSibling());
// check third div, should have one sibling and one #text child
final Div thirdDiv = divs.get(2);
assertEquals("Wrong number of children", 1, thirdDiv.getChildRelationships().size());
assertNotNull("Node should have one sibling", thirdDiv.getNextSibling());
// check fourth div, should have no siblings and no children
final Div fourthDiv = divs.get(3);
assertEquals("Wrong number of children", 0, fourthDiv.getChildRelationships().size());
assertNull("Node should not have siblings", fourthDiv.getNextSibling());