@Test
	public void testCloseToolWithBackgroundTaskRunningAnswerNo() throws Exception {
		// open a program
		ProgramDB program = new ProgramBuilder("notepad", ProgramBuilder._TOY).getProgram();

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

		// start a background task that will run until we tell it to finish.
		ControllableBackgroundCommand cmd = new ControllableBackgroundCommand();
		tool.executeBackgroundCommand(cmd, program);
		waitForCommandToStart(cmd);

		// try to close the tool
		closeTool(tool);

		// check for warning dialog
		OptionDialog dialog = waitForDialogComponent(OptionDialog.class);
		assertNotNull("Did not get option dialog to terminate tasks", dialog);
		pressButtonByText(dialog, "No");

		// try to close the program
		closeProgram(tool, program);

		// check for warning dialog
		Window window = waitForWindow("Close notepad Failed");
		assertNotNull("Did not get \"close failed\" dialog", window);
		closeWindow(window);

		// stop background task
		stopBackgroundCommand(tool, cmd);

		// 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