@Test
	public void testDeleteView() throws Exception {

		env.showTool();

		// delete the "Tree Two" view
		setCurrentViewProvider("Tree Two");

		final DockingActionIf deleteAction = getAction(plugin, "Delete Tree View");
		performAction(deleteAction);

		waitForBusyTool(tool);

		assertNull(program.getListing().getRootModule("Tree Two"));
		String[] treeNames = program.getListing().getTreeNames();
		assertEquals(treeNames.length, tabbedPane.getTabCount());
		// view reverts to first tree
		assertEquals(0, tabbedPane.getSelectedIndex());
		assertTrue(provider.getCurrentView().hasSameAddresses(cb.getView()));

		undo(program);

		// Tree Two should come back
		assertNotNull(program.getListing().getRootModule("Tree Two"));
		ViewProviderService vps = provider.getCurrentViewProvider();
		assertEquals("Tree Two", vps.getViewName());
		assertTrue(provider.getCurrentView().hasSameAddresses(cb.getView()));
		assertTrue(provider.getCurrentView().hasSameAddresses(vps.getCurrentView()));

		redo(program);

		assertNull(program.getListing().getRootModule("Tree Two"));
		treeNames = program.getListing().getTreeNames();
		assertEquals(treeNames.length, tabbedPane.getTabCount());
		// view reverts to first tree
		assertEquals(0, tabbedPane.getSelectedIndex());
		assertTrue(provider.getCurrentView().hasSameAddresses(cb.getView()));
		assertTrue(provider.getCurrentView().hasSameAddresses(vps.getCurrentView()));

	}
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