}
public void testLeafNode() {
Text c1 = new Text("data");
assertEquals(0, c1.getChildCount());
try {
c1.getChild(0);
fail("Didn't throw IndexOutofBoundsException");
}
catch (IndexOutOfBoundsException success) {
// success
}
assertNull(c1.getParent());
Element element = new Element("test");
element.appendChild(c1);
assertEquals(element, c1.getParent());
assertEquals(c1, element.getChild(0));
element.removeChild(c1);
assertEquals(0, element.getChildCount());