GuiceModuleLoader extends AbstractModule { public static Injector initiate(Module... modules) { List<Module> moduleList = new ArrayList<>(); moduleList.addAll(getModules()); moduleList.addAll(Arrays.asList(modules)); try { return Guice.createInjector(moduleList); } catch (CreationException e) { if (e.getErrorMessages().stream() .map(Message::getCause) .allMatch(OxalisLoadingException.class::isInstance)) { e.getErrorMessages().stream() .map(Message::getCause) .filter(distinctByKey(Throwable::getMessage)) .forEach(c -> log.error(c.getMessage(), c)); throw new OxalisLoadingException("Unable to load Oxalis due to errors during loading."); } throw e; } }  static Injector initiate(Module... modules);  }
@Test public void simple() { GuiceModuleLoader.initiate(); }