@Test
	public void testCloseAll() throws Exception {
		openPrograms(programNames);

		for (int i = 0; i < programs.length - 1; i++) {
			JPanel tab = panel.getTab(programs[i]);
			JLabel iconLabel = (JLabel) findComponentByName(tab, "Close");
			Point p = iconLabel.getLocationOnScreen();
			clickMouse(iconLabel, MouseEvent.BUTTON1, p.x + 1, p.y + 1, 1, 0);

			JDialog dlg = waitForJDialog("Program Changed");
			JButton button = findButtonByText(dlg, "Continue");
			pressButton(button);
		}

		// Last program does not have a tab
		ProgramManagerPlugin programMgr = env.getPlugin(ProgramManagerPlugin.class);
		runSwingLater(() -> programMgr.closeProgram());

		waitForSwing();

		JDialog dlg = waitForJDialog("Program Changed");
		JButton button = findButtonByText(dlg, "Continue");
		pressButton(button);

		waitForSwing();

		assertEquals(0, panel.getTabCount());
	}
Tests for the plugin that manages the tab for multiple open programs.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/progmgr/MultiTabPluginTest.java