MoreModules { public static Module lazilyInstantiated(final Class<? extends Module> moduleClass) { return new AbstractModule() { @Override protected void configure() { install(getModule(moduleClass)); } }; } private  MoreModules(); static Module lazilyInstantiated(final Class<? extends Module> moduleClass);  }
@Test public void testLazilyInstantiated() { Injector injector = Guice.createInjector(MoreModules.lazilyInstantiated(StringInstaller.class)); assertEquals(STRING, injector.getInstance(String.class)); }