public static void setAttributeValue(Document document, String containerNodeName, String attributeName, String attributeValue) {
        asStream(document.getElementsByTagName(containerNodeName))
                .map(Node::getAttributes)
                .map(attributes -> attributes.getNamedItem(attributeName))
                .filter(Objects::nonNull)
                .forEach(attributeNode -> attributeNode.setNodeValue(attributeValue));
    }
@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);
        assertThat(newValue).isEqualTo(retrieved.values().toArray()[0]);
        DOMParserUtil.setAttributeValue(document, MAIN_NODE, NOT_EXISTING, newValue);
        retrieved = DOMParserUtil.getAttributeValues(document, MAIN_NODE, NOT_EXISTING);
        assertThat(retrieved).isEmpty();
        DOMParserUtil.setAttributeValue(document, CHILD_NODE, CHILD_ATTRIBUTE_NAME, newValue);
        retrieved = DOMParserUtil.getAttributeValues(document, CHILD_NODE, CHILD_ATTRIBUTE_NAME);
        assertThat(retrieved).hasSize(2);
        retrieved.values().forEach(attributeValue -> assertThat(attributeValue).isEqualTo(newValue));
    }