@Test
	public void testCreateDefaultView() throws Exception {
		ProgramTreePlugin treePlugin = env.getPlugin(ProgramTreePlugin.class);
		final DockingActionIf createTreeAction = getAction(treePlugin, "Create Default Tree View");
		SwingUtilities
				.invokeAndWait(() -> createTreeAction.actionPerformed(new DefaultActionContext()));
		program.flushEvents();

		ViewProviderService vps = provider.getCurrentViewProvider();

		String[] treeNames = program.getListing().getTreeNames();

		assertEquals(treeNames.length, tabbedPane.getTabCount());
		assertEquals(DEFAULT_TREE_NAME + "(1)", vps.getViewName());
		assertEquals(tabbedPane.getSelectedComponent(), vps.getViewComponent());
		performAction(createTreeAction);
		program.flushEvents();
		vps = provider.getCurrentViewProvider();
		treeNames = program.getListing().getTreeNames();

		assertEquals(treeNames.length, tabbedPane.getTabCount());
		assertEquals(DEFAULT_TREE_NAME + "(2)", vps.getViewName());
		assertEquals(tabbedPane.getSelectedComponent(), vps.getViewComponent());

	}
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