GTreeNode createObject(GTreeNode parenGTreeNode, String newName, DockingActionIf action)
			throws Exception {

		assertNotNull(action);

		selectNode(parenGTreeNode);
		int childCount = parenGTreeNode.getChildCount();
		int parentIndex = parenGTreeNode.getIndexInParent();
		GTreeNode grandParentNode = parenGTreeNode.getParent();

		AbstractDockingTest.performAction(action, getSymbolTreeContext(), false);
		waitForSwing();
		waitForTree();
		program.flushEvents();

		if (grandParentNode != null) {
			parenGTreeNode = grandParentNode.getChild(parentIndex);
		}

		GTreeNode newNode = parenGTreeNode.getChild(childCount > 0 ? childCount - 1 : 0);

		waitForTree();

		runSwing(() -> tree.stopEditing());
		waitForCondition(() -> !tree.isEditing());

		rename(newNode, newName);
		return parenGTreeNode.getChild(newName);
	}
A comparator to sort Symbols the same way as the SymbolNode sorts
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/symboltree/SymbolTreeTestUtils.java