code: public static <T> List<T> load(final Class<T> type, final ClassLoader classLoader) {
          final List<T> loaded = new ArrayList<>();
          final Iterator<T> iterator = ServiceLoader.load(type, classLoader).iterator();
          while (hasNextSafely(iterator)) {
              try {
                  final T next = iterator.next();
                  loaded.add(next);
                  LOGGER.debug("Found {}", type);
              } catch (Exception e) {
                  LOGGER.error("Could not load {}: {}", type, e);
              }
          }
          return loaded;
      }
docs: Load implementation by given type.
  
  @param <T>         type of implementation.
  @param type        the type of implementation to load.
  @param classLoader the class loader to search for implementations.
  @return loaded implementations.