protected static TreePath findPathToText(JTree tree, TreePath startTreePath, String text) {
		if (text.equals(startTreePath.getLastPathComponent().toString())) {
			return startTreePath;
		}
		tree.expandPath(startTreePath);
		int len = startTreePath.getPathCount();
		Object[] tpObjects = new Object[len + 1];
		System.arraycopy(startTreePath.getPath(), 0, tpObjects, 0, len);
		TreeNode treeNode = (TreeNode) startTreePath.getLastPathComponent();
		int num = treeNode.getChildCount();
		for (int i = 0; i < num; i++) {
			TreeNode childNode = treeNode.getChildAt(i);
			tpObjects[len] = childNode;
			TreePath childPath = new TreePath(tpObjects);
			TreePath treePath = findPathToText(tree, childPath, text);
			if (treePath != null) {
				return treePath;
			}
		}
		return null;
	}
Performs a depth first search for the named tree node.

@param tree the tree to search
@param startTreePath path indicating node to begin searching from in the
           tree
@param text the name of the node to find
@return the path to the named node or null if it can't be found.
Ghidra/Framework/Gui/src/main/java/generic/test/AbstractGuiTest.java