public Node getNext() {
        if (parent == null) return null;

        int parentIndex = parent.indexOf(this);

        if (parentIndex == -1) return null;
        
        if (parentIndex == parent.size() - 1) return parent.getNext();

        return parent.get(parentIndex + 1);
    }
Returns the next SchemaNode of the sibilings of the node.
If there is no next node, it returns the next node of the parent node.

@return the next SchemaNode or null if there is no next node
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/tree/Node.java