### Question:
ModuleLoader { public List<Module> load(Class<? extends ModuleProvider> providerClass) { return loadModules(ServiceLoader.load(providerClass)); }  List<Module> load(Class<? extends ModuleProvider> providerClass); List<Module> load(Class<? extends ModuleProvider> providerClass, ClassLoader classLoader);  }### Answer:
@Test public void testLoad() { List<Module> modules = new ModuleLoader().load(ModuleProvider.class); assertEquals(4, modules.size()); assertTrue(String.valueOf(modules.get(0)), modules.get(0) instanceof Module3); assertTrue(String.valueOf(modules.get(1)), modules.get(1) instanceof Module4); assertTrue(String.valueOf(modules.get(2)), modules.get(2) instanceof Module2); assertTrue(String.valueOf(modules.get(3)), modules.get(3) instanceof Module1); Injector i = DIBootstrap.createInjector(modules); assertEquals("a", i.getInstance(String.class)); assertEquals(Integer.valueOf(56), i.getInstance(Integer.class)); }
@Test public void testLoadCustom() { List<Module> modules = new ModuleLoader().load(CustomModuleProvider.class); assertEquals(2, modules.size()); assertTrue(String.valueOf(modules.get(0)), modules.get(0) instanceof Module5); assertTrue(String.valueOf(modules.get(1)), modules.get(1) instanceof Module6); Injector i = DIBootstrap.createInjector(modules); assertEquals(Integer.valueOf(66), i.getInstance(Integer.class)); }