public GTreeNode findSymbolTreeNode(SymbolNode key, boolean loadChildren, TaskMonitor monitor) {

		// if we don't have to loadChildren and we are not loaded get out.
		if ((!isLoaded() && !loadChildren) || monitor.isCancelled()) {
			return null;
		}

		// see if the given node is the node we want
		Symbol searchSymbol = key.getSymbol();
		if (getSymbol() == searchSymbol) {
			return this;
		}

		List<GTreeNode> children = getChildren();
		int index = Collections.binarySearch(children, key, getChildrenComparator());
		if (index >= 0) {
			GTreeNode node = children.get(index);
			SymbolTreeNode symbolNode = (SymbolTreeNode) node;
			if (symbolNode.getSymbol() == searchSymbol) {
				return symbolNode;
			}

			// At this point we know that the given child is not itself a symbol node, but it 
			// may contain a child that contains the symbol node (some symbol nodes will
			// themselves contain more symbol nodes).  
			// Ask that child to search.  Leave this method regardless, as if this child does
			// not have it, then none of the others will.
			node = symbolNode.findSymbolTreeNode(key, loadChildren, monitor);
			return node;
		}

		// Brute-force lookup in each child.  This will not typically be called.  Category nodes 
		// that support large numbers of children have overridden this method to perform smarter
		// searching.
		for (GTreeNode childNode : children) {
			if (monitor.isCancelled()) {
				return null;
			}
			if (!(childNode instanceof SymbolTreeNode)) {
				continue; // InProgressNode
			}

			SymbolTreeNode symbolNode = (SymbolTreeNode) childNode;
			GTreeNode foundNode = symbolNode.findSymbolTreeNode(key, loadChildren, monitor);
			if (foundNode != null) {
				return foundNode;
			}
		}

		return null;
	}
Locates the node that contains the given symbol.

<p><b>Note: </b>This can degenerate into a brute-force search algorithm, but works in 
all normal cases using a binary search.
 
@param key the node used to find an existing node.  This node is a node created that is
       used by the Comparators to perform binary searches.  These can be fabricated 
       by using {@link SymbolNode#createNode(Symbol, Program)}
@param loadChildren if true then children should be loaded, else quit early if 
       children are not loaded.
@param monitor the task monitor
@return the node that contains the given symbol.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/symboltree/nodes/SymbolTreeNode.java