@Test
	public void testDeleteLocalVariable() throws Exception {
		GTreeNode functionsNode = getFunctionsNode();
		util.expandNode(functionsNode);

		GTreeNode ghidraNode = functionsNode.getChild(1);
		util.expandNode(ghidraNode);

		GTreeNode node = ghidraNode.getChild(9);
		util.selectNode(node);
		int count = ghidraNode.getChildCount();

		ActionContext context = util.getSymbolTreeContext();
		performTreeAction(deleteAction, context);

		assertEquals(count - 1, ghidraNode.getChildCount());
		for (int i = 0; i < count - 1; i++) {
			GTreeNode n = ghidraNode.getChild(i);
			Symbol s = ((SymbolNode) n).getSymbol();
			assertFalse(s.getName().equals("AnotherLocal"));
		}

		// test undo/redo
		undo(program);

		util.waitForTree();
		functionsNode = getFunctionsNode();
		ghidraNode = functionsNode.getChild(1);
		boolean found = false;
		for (int i = 0; i < count - 1; i++) {
			GTreeNode n = ghidraNode.getChild(i);
			Symbol s = ((SymbolNode) n).getSymbol();
			if (s.getName().equals("AnotherLocal")) {
				found = true;
				break;
			}
		}
		assertTrue(found);

		redo(program);

		util.waitForTree();
		functionsNode = getFunctionsNode();
		ghidraNode = functionsNode.getChild(1);

		for (int i = 0; i < count - 1; i++) {
			GTreeNode n = ghidraNode.getChild(i);
			Symbol s = ((SymbolNode) n).getSymbol();
			assertNotEquals("AnotherLocal", s.getName());
		}
	}
Tests for the symbol tree plugin.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/symboltree/SymbolTreePlugin2Test.java