@Test public void getCandidatesViaHardCoded_failAtInit() throws Exception { try { Iterable<ServiceProvidersTestAbstractProvider> ignored = ServiceProviders.getCandidatesViaHardCoded( ServiceProvidersTestAbstractProvider.class, Collections.<Class<?>>singletonList(FailAtInitProvider.class)); fail("Expected exception"); } catch (ServiceConfigurationError expected) { } }
@VisibleForTesting static <T> Iterable<T> getCandidatesViaHardCoded(Class<T> klass, Iterable<Class<?>> hardcoded) { List<T> list = new ArrayList<>(); for (Class<?> candidate : hardcoded) { list.add(create(klass, candidate)); } return list; }
ServiceProviders { @VisibleForTesting static <T> Iterable<T> getCandidatesViaHardCoded(Class<T> klass, Iterable<Class<?>> hardcoded) { List<T> list = new ArrayList<>(); for (Class<?> candidate : hardcoded) { list.add(create(klass, candidate)); } return list; } }
ServiceProviders { @VisibleForTesting static <T> Iterable<T> getCandidatesViaHardCoded(Class<T> klass, Iterable<Class<?>> hardcoded) { List<T> list = new ArrayList<>(); for (Class<?> candidate : hardcoded) { list.add(create(klass, candidate)); } return list; } private  ServiceProviders(); }
ServiceProviders { @VisibleForTesting static <T> Iterable<T> getCandidatesViaHardCoded(Class<T> klass, Iterable<Class<?>> hardcoded) { List<T> list = new ArrayList<>(); for (Class<?> candidate : hardcoded) { list.add(create(klass, candidate)); } return list; } private  ServiceProviders(); static T load(
      Class<T> klass,
      Iterable<Class<?>> hardcoded,
      ClassLoader cl,
      PriorityAccessor<T> priorityAccessor); static List<T> loadAll(
      Class<T> klass,
      Iterable<Class<?>> hardcoded,
      ClassLoader cl,
      final PriorityAccessor<T> priorityAccessor); @VisibleForTesting static Iterable<T> getCandidatesViaServiceLoader(Class<T> klass, ClassLoader cl); }
ServiceProviders { @VisibleForTesting static <T> Iterable<T> getCandidatesViaHardCoded(Class<T> klass, Iterable<Class<?>> hardcoded) { List<T> list = new ArrayList<>(); for (Class<?> candidate : hardcoded) { list.add(create(klass, candidate)); } return list; } private  ServiceProviders(); static T load(
      Class<T> klass,
      Iterable<Class<?>> hardcoded,
      ClassLoader cl,
      PriorityAccessor<T> priorityAccessor); static List<T> loadAll(
      Class<T> klass,
      Iterable<Class<?>> hardcoded,
      ClassLoader cl,
      final PriorityAccessor<T> priorityAccessor); @VisibleForTesting static Iterable<T> getCandidatesViaServiceLoader(Class<T> klass, ClassLoader cl);  }