public void dispose() {

		instances.remove(this);

		AbstractDockingTest.disposeErrorGUI();

		printOpenModalDialogs();

		try {
			disconnectConnectedTools();
		}
		catch (Throwable t) {
			Msg.error(TestEnv.class, "Problem disconnecting tools", t);
		}

		disposeAllTasks();

		markAllProgramsAsUnchanged();

		disposeTestTools();

		privateWaitForSwingRunnables();
		programManager.disposeOpenPrograms();

		if (gp.getProject() == null) {
			throw new IllegalStateException("The TestEnv's GhidraProject has already been closed!");
		}

		Project project = gp.getProject();
		String projectName = project.getName();
		try {
			AbstractGuiTest.runSwing(() -> gp.close());
		}
		catch (Throwable t) {
			Msg.error(TestEnv.class, "Problem disposing the test project", t);
		}

		privateWaitForSwingRunnables();

		disposeFrontEndTool();

		AbstractDockingTest.closeAllWindows(true);

		disposeAllSwingUpdateManagers();

		deleteTestProject(projectName);
	}
Closes the given program, ignoring all changes, for each tool known to this TestEnv.

@param p the program to close
Ghidra/Features/Base/src/main/java/ghidra/test/TestEnv.java