private void waitForSearchTasks(SearchTextDialog dialog) throws InterruptedException {
		waitForSwing();
		Thread t = dialog.getTaskScheduler().getCurrentThread();
		if (t == null) {
			// just in case we missed the thread and the callback hasn't happened yet
			waitForSwing();
			t = dialog.getTaskScheduler().getCurrentThread();
		}

		while (t != null) {
			t.join(DEFAULT_WAIT_TIMEOUT);
			waitForSwing();
			t = dialog.getTaskScheduler().getCurrentThread();
		}
		waitForSwing();
	}
Tests for the search text plugin.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/searchtext/SearchTextPlugin1Test.java