private Injector createInjectorFor(final List<Class<? extends AbstractModule>> classes) throws InitializationError {
  List<AbstractModule> modules=Lists.newArrayList();
  for (  Class<? extends AbstractModule> clazz : classes) {
    try {
      modules.add(clazz.newInstance());
    }
 catch (    InstantiationException|IllegalAccessException e) {
      throw new IllegalStateException(e);
    }
  }
  return Guice.createInjector(modules);
}

private Injector createInjectorFor ( final List < Class < ? extends AbstractModule > > classes ) throws InitializationError { List < AbstractModule > modules = Lists . newArrayList ( ) ; for ( Class < ? extends AbstractModule > clazz : classes ) { try { modules . add ( clazz . newInstance ( ) ) ; } catch ( InstantiationException | IllegalAccessException e ) { throw new IllegalStateException ( e ) ; } } return Guice . createInjector ( modules ) ; }
create a guice injector for the class under test .
