class NodePath {

    public Optional<JsonNode> findMatchingDescendant(JsonNode rootNode) {
        JsonNode current = rootNode;

        for (PathElement element : elements) {
            current = element.child(current);

            if (current == null) {
                return Optional.empty();
            }
        }

        return Optional.ofNullable(current);
    }

    public  NodePath(String path);
      NodePath(List<PathElement> elements);

}