public static <T> T inRunningToolsPreferringActive(PluginTool tool,
			Function<? super PluginTool, ? extends T> action) {
		Tool activeTool = DockingWindowManager.getActiveInstance().getTool();
		if (activeTool instanceof PluginTool) {
			PluginTool activePluginTool = (PluginTool) activeTool;
			T result = action.apply(activePluginTool);
			if (result != null) {
				return result;
			}
		}
		for (PluginTool pt : tool.getToolServices().getRunningTools()) {
			T result = action.apply(pt);
			if (result != null) {
				return result;
			}
		}
		return null;
	}
Attempts the given action in all running tools, starting with the active one, if applicable

<p>
This will stop once the given action returns a non-null result, and return that result.

@param <T> the type of result
@param tool the front-end tool, whose running plugin tools to try
@param action the action to apply to each plugin tool
@return the first non-null result of the action, or null if all plugin tools were exhausted
Ghidra/Debug/ProposedUtils/src/main/java/ghidra/framework/plugintool/PluginToolUtils.java