Node child1 = new Text("http://www.mauve.com");
parent.appendChild(child1);
Node child2 = new ProcessingInstruction(
"child", "http://www.mauve.com");
parent.appendChild(child2);
Node child3 = new Comment("http://www.mauve.com");
parent.appendChild(child3);
assertEquals(parent, child3.getParent());
assertEquals(parent, child1.getParent());
assertEquals(parent, child2.getParent());
Nodes result = parent.removeChildren();
assertEquals(0, parent.getChildCount());
assertNull(child1.getParent());
assertNull(child2.getParent());
assertNull(child3.getParent());
assertEquals(parent, a1.getParent());
assertEquals(3, result.size());
assertEquals(child1, result.get(0));
assertEquals(child2, result.get(1));