public void testRemoveAll()
{
final Document document = new Document();
final Node parent = new Node();
document.addChild(parent);
final Elements<Node> elements = new Nodes(parent);
final Node child = new Node();
child.setId("ID");
child.setSid("SID");
elements.add(child);
final List<Object> toDelete = new ArrayList<Object>();
toDelete.add(new Node());
toDelete.add("test");
assertFalse(elements.removeAll(toDelete));
assertSame(parent, child.getParent());
toDelete.add(child);
assertTrue(elements.removeAll(toDelete));
// Check if node was correctly detached from elements
assertEquals(0, elements.size());
assertNull(child.getParent());
assertNull(child.getDocument());
assertNull(document.getById("ID"));
assertNull(document.getBySid("SID"));
assertNull(parent.getBySid("SID"));