public Node getSibling(int relativeIndex) {
        if (parent == null)return null;

        int parentIndex = parent.indexOf(this);

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

        int siblingIndex = parentIndex + relativeIndex;
        if (siblingIndex < 0 || siblingIndex >= parent.size()) return null;
        
        return parent.get(siblingIndex);
    }
Returns the sibling node at the specified relative index.
A sibling node is a node that shares the same parent node.

@param relativeIndex the relative index of the sibling node
@return the sibling node at the specified relative index, or null if the sibling node does not exist
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/tree/Node.java