class ListCollectingServiceLoader implements CollectingServiceLoader<S> {

  @Override
  public Collection<S> loadServices(Class<S> service) {
    serviceLoaderWrapper.load(service);

    Collection<S> services = new ArrayList<>();
    for (Iterator<S> iterator = serviceLoaderWrapper.iterator(); iterator.hasNext();) {
      try {
        S instance = iterator.next();
        services.add(instance);
      } catch (ServiceConfigurationError serviceConfigurationError) {
        logger.error("Error while loading implementations of {}", service.getName(),
            serviceConfigurationError);
      }
    }

    return services;
  }

  public  ListCollectingServiceLoader();
  @VisibleForTesting  ListCollectingServiceLoader(ServiceLoaderWrapper<S> serviceLoaderWrapper);

}