private TreePath getTreePathFromGroup(GroupPath gp) {
		TreePath path = findTreePath(gp);
		if (path == null) {
			// Node has not been fully populated, so it wasn't found,
			// so find the first path we have
			//
			GroupPath parentgp = null;
			parentgp = gp.getParentPath();
			while (parentgp != null) {

				path = findTreePath(parentgp);
				if (path != null) {
					break;
				}
				parentgp = parentgp.getParentPath();
			}
			if (path == null) {
				return null;
			}

			// visit the node to populate its children
			ProgramNode node = (ProgramNode) path.getLastPathComponent();

			if (!node.wasVisited()) {
				visitAllNodes(node);

				buildNodeList();
			}
			path = findTreePath(gp);
		}
		return path;
	}
Get the tree path for the given group path; populate the node
if it has not been visited.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/programtree/ProgramDnDTree.java