@Test
	public void testDeleteLastVisibleView() throws Exception {

		final DockingActionIf closeAction = getAction(plugin, "Close Tree View");

		setCurrentViewProvider(DEFAULT_TREE_NAME);
		performAction(closeAction);

		setCurrentViewProvider("Main Tree");
		runSwing(() -> {
			closeAction.actionPerformed(new DefaultActionContext());
			provider.setCurrentViewProvider("Tree One");
			closeAction.actionPerformed(new DefaultActionContext());
			provider.setCurrentViewProvider("Tree Two");
			closeAction.actionPerformed(new DefaultActionContext());
			provider.setCurrentViewProvider("Tree Three");
			DockingActionIf deleteAction = getAction(plugin, "Delete Tree View");
			deleteAction.actionPerformed(new DefaultActionContext());
		});
		// cannot delete the last view
		ViewProviderService vps = provider.getCurrentViewProvider();
		assertEquals("Tree Three", vps.getViewName());
		assertEquals(tabbedPane.getSelectedComponent(), vps.getViewComponent());
		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