static ConfigNode propsToNode(Map<String, String> properties) {
        String rootNode = findRootNode(properties);

        ConfigNode root = new ConfigNode(rootNode);
        for (Map.Entry<String, String> e : properties.entrySet()) {
            parseEntry(e.getKey().replaceFirst(rootNode + ".", ""), e.getValue(), root);
        }
        return root;
    }
@Test
    public void shouldParse() {
        Map<String, String> m = new HashMap<>();
        m.put("foo.bar1", "1");
        m.put("foo.bar2", "2");
        m.put("foo.bar3.bar4", "4");
        ConfigNode configNode = PropertiesToNodeConverter.propsToNode(m);

        assertNull(configNode.getValue());
        assertEquals("foo", configNode.getName());
        assertEquals(3, configNode.getChildren().size());
        assertEquals("1", configNode.getChildren().get("bar1").getValue());
        assertEquals("2", configNode.getChildren().get("bar2").getValue());
        assertEquals("4", configNode.getChildren().get("bar3").getChildren().get("bar4").getValue());
    }