void rename(GTreeNode node, final String newName) throws Exception {
		selectNode(node);

		final TreePath path = node.getTreePath();
		assertTrue(tree.isPathSelected(path));

		final GTreeNode nsNode = node;
		assertTrue(renameAction.isEnabledForContext(getSymbolTreeContext()));
		runSwing(() -> renameAction.actionPerformed(getSymbolTreeContext()));

		waitForTree();

		runSwing(() -> {
			int row = tree.getRowForPath(path);
			JTree jTree = (JTree) getInstanceField("tree", tree);
			DefaultTreeCellEditor cellEditor = (DefaultTreeCellEditor) tree.getCellEditor();
			Container container = (Container) cellEditor.getTreeCellEditorComponent(jTree, nsNode,
				true, true, true, row);
			JTextField textField = (JTextField) container.getComponent(0);

			textField.setText(newName);
			tree.stopEditing();
		});
		program.flushEvents();
		waitForSwing();
		waitForTree();
	}
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