public TreeCursor getRoot() {
        TreeCursor current = this;
        while (current.parent != null) {
            current = current.parent;
        }
        return current;
    }
Get the root of the tree, returning itself if the tree has no parent.

@return Non-nullable root tree.
smithy-syntax/src/main/java/software/amazon/smithy/syntax/TreeCursor.java