@Test
void buildPropertiesElement() throws ParserConfigurationException {

    Element properties = BuilderUtils.buildPropertiesElement(new HashMap<String, Object>() {{
        put("keyString", "value1");
        put("keyInteger", 1);
        put("keyLong", 1L);
        put("keyBoolean", true);
    }}, DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument());
    NodeList propertyNodes = properties.getElementsByTagName("l7:Property");
    for (Node property : DocumentUtils.nodeList(propertyNodes)) {
        Node key = property.getAttributes().getNamedItem("key");
        switch (key.getTextContent()) {
            case "keyString":
                NodeList valueString = ((Element) property).getElementsByTagName(STRING_VALUE);
                assertEquals("value1", valueString.item(0).getTextContent());
                break;
            case "keyInteger":
                NodeList valueInt = ((Element) property).getElementsByTagName(INTEGER_VALUE);
                assertEquals(1, Integer.valueOf(valueInt.item(0).getTextContent()).intValue());
                break;
            case "keyLong":
                NodeList valueLong = ((Element) property).getElementsByTagName(LONG_VALUE);
                assertEquals(1L, Long.valueOf(valueLong.item(0).getTextContent()).longValue());
                break;
            case "keyBoolean":
                NodeList valueBoolean = ((Element) property).getElementsByTagName(BOOLEAN_VALUE);
                assertEquals(true, Boolean.valueOf(valueBoolean.item(0).getTextContent()));
                break;
            default:
                fail("Unexpected key " + key.getTextContent());
        }
    }
}