public void testTextContent() {
    Node node = XMLTools.child(this.rootNode, "element-0");
    Node childNode = XMLTools.child(node, "element-0-text-1");
    assertEquals("some text", XMLTools.textContent(childNode));

    childNode = XMLTools.child(node, "element-0-text-2");
    assertEquals("", XMLTools.textContent(childNode));

    childNode = XMLTools.child(node, "element-0-text-3");
    assertEquals("", XMLTools.textContent(childNode));

    childNode = XMLTools.child(node, "element-0-non-text");
    boolean exCaught = false;
    try {
      String text = XMLTools.textContent(childNode);
      text = text.toString();
    } catch (IllegalArgumentException ex) {
      exCaught = true;
    }
    assertTrue(exCaught);
  }