@Test
	public void testExternalRename() throws Exception {
		// rename a label in the global namespace
		// verify that the tree updates

		Function f = program.getFunctionManager().getFunctionAt(util.addr(0x01002cf5L));
		Symbol s = getUniqueSymbol(program, "AnotherLocal", f);
		assertNotNull(s);

		tx(program, () -> {
			s.setName("MyAnotherLocal", SourceType.USER_DEFINED);
		});

		util.waitForTree();

		GTreeNode fNode = getFunctionsNode();
		util.expandNode(fNode);

		GTreeNode gNode = fNode.getChild(1);
		util.expandNode(gNode);

		GTreeNode node = gNode.getChild(9);
		assertEquals("MyAnotherLocal", (((SymbolNode) node).getSymbol()).getName());

		// undo/redo
		undo(program);
		util.waitForTree();

		fNode = getFunctionsNode();
		util.expandNode(fNode);

		gNode = fNode.getChild(1);
		util.expandNode(gNode);

		node = gNode.getChild(9);
		assertEquals("AnotherLocal", (((SymbolNode) node).getSymbol()).getName());

		redo(program);
		fNode = getFunctionsNode();
		util.expandNode(fNode);

		gNode = fNode.getChild(1);
		util.expandNode(gNode);

		node = gNode.getChild(9);
		assertEquals("MyAnotherLocal", (((SymbolNode) node).getSymbol()).getName());
	}
Tests for the symbol tree plugin.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/symboltree/SymbolTreePlugin2Test.java