private Class<? extends Plugin> discoverServiceProvider(Class<?> dependency) {

		Class<? extends Plugin> pluginClass =
			PluginUtils.getDefaultProviderForServiceClass(dependency);
		if (pluginClass != null) {
			return pluginClass;
		}

		//
		// This is searching for any non-loaded Plugin that implements the required service 
		// interface.  Under normal tool configuration, we will not get to this point, since we will
		// have loaded default service providers using the "defaultProvider" annotation attribute.
		// 
		// This code attempts to find the needed plugins by finding service providers that either 
		// implement the service interface or declare that they provide an implementation.
		//
		List<Class<? extends Plugin>> plugins = ClassSearcher.getClasses(Plugin.class)
				.stream()
				.filter(pluginsConfiguration::accepts)
				.collect(Collectors.toList());
		List<Class<? extends Plugin>> serviceProviders = new ArrayList<>();
		for (Class<? extends Plugin> pc : plugins) {

			if (dependency.isAssignableFrom(pc)) {
				serviceProviders.add(pc);
				continue;
			}

			PluginDescription pd = PluginDescription.getPluginDescription(pc);
			List<Class<?>> servicesProvided = pd.getServicesProvided();
			for (Class<?> service : servicesProvided) {
				if (dependency.isAssignableFrom(service)) {
					serviceProviders.add(pc);
				}
			}
		}

		if (serviceProviders.isEmpty()) {
			return null;
		}

		Class<? extends Plugin> choice = serviceProviders.get(0);
		if (serviceProviders.size() != 1) {
			// no choice to be made; just return the only implementation we found
			Msg.warn(this, """
					Unable to find the preferred service provider implementation for %s.
					Picking %s
					""".formatted(dependency.getName(), choice.getName()));
		}

		return choice;
	}
@param dependencies set of service interface classes that are required by some plugin
and are not provided by a loaded plugin.
@return boolean true if there was any progress on resolving dependencies, false
if there was no progress or nothing to do.
Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/PluginManager.java