private void disposeAllTasks() {

		// Note: background tool tasks are disposed by the tool

		@SuppressWarnings("unchecked")
		Map<Task, TaskMonitor> tasks = (Map<Task, TaskMonitor>) TestUtils
				.getInstanceField("runningTasks", TaskUtilities.class);
		for (TaskMonitor tm : tasks.values()) {
			tm.cancel();
		}

		// wait just a bit for the tasks to finish; we don't really care at this point, since
		// we are disposing
		AbstractGTest.waitForConditionWithoutFailing(() -> !TaskUtilities.isExecutingTasks());
		privateWaitForSwingRunnables();
	}
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