private GTreeNode getNodeForPath(GTreeNode root, TreePath path) {
		if (path == null || root == null) {
			return null;
		}

		GTreeNode node = (GTreeNode) path.getLastPathComponent();
		if (path.getPathCount() == 1) {
			if (root.equals(node)) {
				return root;
			}
			return null; // invalid path--the root of the path is not equal to our root!
		}

		if (node.getRoot() == root) {
			return node; // this node is a valid child of the given root
		}

		TreePath parentPath = path.getParentPath();
		GTreeNode parentNode = getNodeForPath(root, parentPath);
		if (parentNode == null) {
			return null; // must be a path we don't have
		}

		GTreeNode lastPathComponent = (GTreeNode) path.getLastPathComponent();
		List<GTreeNode> children = parentNode.getChildren();
		for (GTreeNode child : children) {
			if (child.equals(lastPathComponent)) {
				return child;
			}
		}
		return null;
	}
Gets the view node for the given path. This is useful to translate to a tree path that is
valid for the currently displayed tree. (Remember that if the tree is filtered, then the
displayed nodes are clones of the model nodes.)

@param path the path of the node
@return the current node in the displayed (possibly filtered) tree
Ghidra/Framework/Docking/src/main/java/docking/widgets/tree/GTree.java