@Test
public void getNestedChildrenNodesMap() throws Exception {

    Document document = DOMParserUtil.getDocument(XML);
    Map<Node, List<Node>> retrieved = DOMParserUtil.getNestedChildrenNodesMap(document, MAIN_NODE, CHILD_NODE, TEST_NODE);
    assertNotNull(retrieved);
    assertEquals(2, retrieved.size());
    retrieved.forEach((childNode, testNodes) -> {
        assertEquals(CHILD_NODE, childNode.getNodeName());
        assertEquals(1, testNodes.size());
        assertEquals(TEST_NODE, testNodes.get(0).getNodeName());
    });
    retrieved = DOMParserUtil.getNestedChildrenNodesMap(document, CHILD_NODE, NESTING_NODE, NESTED_NODE);
    assertNotNull(retrieved);
    assertEquals(2, retrieved.size());
    retrieved.forEach((nestingNode, nestedNodes) -> {
        assertEquals(NESTING_NODE, nestingNode.getNodeName());
        assertEquals(1, nestedNodes.size());
        assertEquals(NESTED_NODE, nestedNodes.get(0).getNodeName());
    });
}