@Test
public void replaceNodeText() throws Exception {

    final String replacement = "replacement";
    Document document = DOMParserUtil.getDocument(XML);
    DOMParserUtil.replaceNodeText(document, MAIN_NODE, TEST_NODE, TEST_NODE_CONTENT, replacement);
    final Map<Node, List<Node>> retrieved = DOMParserUtil.getChildrenNodesMap(document, MAIN_NODE, TEST_NODE);
    assertNotNull(retrieved);
    assertEquals(1, retrieved.size());
    List<Node> testNodes = retrieved.values().iterator().next();
    assertNotNull(testNodes);
    assertEquals(1, testNodes.size());
    assertEquals(replacement, testNodes.get(0).getTextContent());
}