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

        int parentIndex = parent.indexOf(this);

        if (parentIndex == -1)return null; // invalid setup

        if (parentIndex == 0)return parent;
        return parent.get(parentIndex - 1);
    }
Returns the previous SchemaNode of the sibilings of the node.
If there is no previous node, it moves upwards to the parent and tries to get the previous node.

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