class ConfigNode {

    public Optional<ConfigNode> getNode(String path) {
        if (path == null) {
            return Optional.empty();
        }
        String[] parts = splitPathInTwo(path);
        String key = parts[0];
        String leftover = parts[1];

        if (leftover.isEmpty()) {
            return Optional.ofNullable(childNodes.get(key));
        } else {
            return getNode(key).flatMap(child -> child.getNode(leftover));
        }
    }

    public  ConfigNode(String key, ConfigNode parent, String value);

}