@Test public void shouldReturnWithPriority() { Machine machine = ServiceLoaderProvider.get(Machine.class); Assertions.assertNotNull(machine); Assertions.assertTrue(machine instanceof Computer); }
public static <T> T get(Class<T> supplier) { return getSupplier(requireNonNull(supplier, "supplier is required")); }
ServiceLoaderProvider { public static <T> T get(Class<T> supplier) { return getSupplier(requireNonNull(supplier, "supplier is required")); } }
ServiceLoaderProvider { public static <T> T get(Class<T> supplier) { return getSupplier(requireNonNull(supplier, "supplier is required")); } private  ServiceLoaderProvider(); }
ServiceLoaderProvider { public static <T> T get(Class<T> supplier) { return getSupplier(requireNonNull(supplier, "supplier is required")); } private  ServiceLoaderProvider(); static T get(Class<T> supplier); static T getUnique(Class<T> supplier); static T getUnique(Class<T> supplier, Predicate<Object> predicate); static I getUnique(Class<T> supplier, Class<I> supplierImplementation); static Stream<Object> getSupplierStream(Class<T> supplier); }
ServiceLoaderProvider { public static <T> T get(Class<T> supplier) { return getSupplier(requireNonNull(supplier, "supplier is required")); } private  ServiceLoaderProvider(); static T get(Class<T> supplier); static T getUnique(Class<T> supplier); static T getUnique(Class<T> supplier, Predicate<Object> predicate); static I getUnique(Class<T> supplier, Class<I> supplierImplementation); static Stream<Object> getSupplierStream(Class<T> supplier);  }