private void triggerSelection(AddressSet set) {

		tool.firePluginEvent(new ProgramSelectionPluginEvent(tableServicePlugin.getName(),
			new ProgramSelection(set), program));
		waitForSwing();

		//
		// Note: the SearchTextPlugin does not listen for program selections.  Rather, it listens
		//       to context changes.  Unfortunately, in the test environment, context updating
		//       fails due to its dependency on focus.  So, update the plugin so it knows to
		//       check for selection updates.
		//
		runSwing(() -> {

			ActionContext actionContext = provider.getActionContext(null);
			plugin.contextChanged(actionContext);
		});
	}
Tests for the search text plugin.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/searchtext/SearchTextPlugin1Test.java