code: public static <T> Optional<T> findFirst(Class<T> clazz) {
      ServiceLoader<T> load = ServiceLoader.load(clazz);
      return StreamSupport.stream(load.spliterator(), false).findFirst();
    }
docs: Finds the first implementation of the given service type and creates its instance.
  
  @param clazz service type
  @return the first implementation of the given service type