@Test
public void setAttributeValue() throws Exception {

    final String newValue = "NEW_VALUE";
    Document document = DOMParserUtil.getDocument(XML);
    DOMParserUtil.setAttributeValue(document, MAIN_NODE, MAIN_ATTRIBUTE_NAME, newValue);
    Map<Node, String> retrieved = DOMParserUtil.getAttributeValues(document, MAIN_NODE, MAIN_ATTRIBUTE_NAME);
    assertEquals(retrieved.values().toArray()[0], newValue);
    DOMParserUtil.setAttributeValue(document, MAIN_NODE, NOT_EXISTING, newValue);
    retrieved = DOMParserUtil.getAttributeValues(document, MAIN_NODE, NOT_EXISTING);
    assertTrue(retrieved.isEmpty());
    DOMParserUtil.setAttributeValue(document, CHILD_NODE, CHILD_ATTRIBUTE_NAME, newValue);
    retrieved = DOMParserUtil.getAttributeValues(document, CHILD_NODE, CHILD_ATTRIBUTE_NAME);
    assertEquals(2, retrieved.size());
    retrieved.values().forEach(attributeValue -> assertEquals(newValue, attributeValue));
}