@Test
	public void testRenameView() throws Exception {
		env.showTool();
		waitForTasks();

		setCurrentViewProvider(DEFAULT_TREE_NAME);

		DockingActionIf renameAction = getAction(plugin, "Rename Tree View");
		performAction(renameAction, false);

		InputDialog dialog = waitForDialogComponent(InputDialog.class);
		dialog.setValue("My Tree");
		pressButtonByText(dialog, "OK");
		waitForProgram(program);

		ViewProviderService vps = runSwing(() -> provider.getCurrentViewProvider());
		assertEquals("My Tree", vps.getViewName());
		assertNull(program.getListing().getRootModule(DEFAULT_TREE_NAME));
		assertTrue(provider.getCurrentView().hasSameAddresses(cb.getView()));
		assertTrue(provider.getCurrentView().hasSameAddresses(vps.getCurrentView()));

		undo(program);
		vps = runSwing(() -> provider.getCurrentViewProvider());
		assertEquals(DEFAULT_TREE_NAME, vps.getViewName());
		assertNotNull(program.getListing().getRootModule(DEFAULT_TREE_NAME));

		redo(program);
		provider.getCurrentViewProvider();
		vps = runSwing(() -> provider.getCurrentViewProvider());
		assertEquals("My Tree", vps.getViewName());
		assertNull(program.getListing().getRootModule(DEFAULT_TREE_NAME));
	}
Test the view manager plugin that controls the view in the browser and the
program tree.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/programtree/ViewManagerPluginTest.java