@Test
	public void testCloseOthersInTool() throws Exception {
		PluginTool tool = env.getTool();
		ProgramManagerPlugin pm = getPlugin(tool, ProgramManagerPlugin.class);

		// launch a tool with the program
		tool = env.launchDefaultTool();

		ProgramDB program1 = new ProgramBuilder("DiffTestPgm2", ProgramBuilder._TOY).getProgram();
		ProgramDB program2 =
			new ProgramBuilder("WinHelloCPP.exe", ProgramBuilder._TOY).getProgram();
		ProgramDB program3 = new ProgramBuilder("DiffTestPgm1", ProgramBuilder._TOY).getProgram();
		pm.openProgram(program1, ProgramManager.OPEN_CURRENT);
		pm.openProgram(program2, ProgramManager.OPEN_CURRENT);
		pm.openProgram(program3, ProgramManager.OPEN_CURRENT);
		Program[] allOpenPrograms = pm.getAllOpenPrograms();
		assertEquals(3, allOpenPrograms.length);

		DockingActionIf closeOthersAction = getAction(pm, "Close Others");
		assertNotNull(closeOthersAction);
		ProgramActionContext context = new ProgramActionContext(null, program1);
		assertEquals(true, closeOthersAction.isEnabledForContext(context));
		performAction(closeOthersAction, context, true);

		allOpenPrograms = pm.getAllOpenPrograms();
		assertEquals(1, allOpenPrograms.length);
		assertEquals(program3, allOpenPrograms[0]);

		// close tool
		assertNotNull(tool.getToolFrame());
		closeTool(tool);
		assertNull("Tool did not close after task", tool.getToolFrame());

	}
test for creating a new empty tool with the new front end
Ghidra/Features/Base/src/test.slow/java/ghidra/framework/project/tool/CloseToolTest.java