Getter to get the root node. If the current node is not a root, then the getter will traverse up the path to get the root.
INode get root => isRoot ? this : this.parent!.root;