ServiceManager { public void start() throws ServiceManagerException { if (internalServiceManager != null) { LOGGER.debug(MESSAGE_ALREADY_STARTED); return; } LOGGER.debug("starting application"); Injector injector = getInjector(); Set<Service> servicesSet = newHashSet(); for (Class<? extends Service> service : this.services.getResources()) { LOGGER.debug("instantiating service: " + service.getSimpleName()); servicesSet.add(injector.getInstance(service)); LOGGER.debug("instantiated service: " + service.getSimpleName()); } internalServiceManager = new com.google.common.util.concurrent.ServiceManager(servicesSet); LOGGER.debug("starting {} services", servicesSet.size()); internalServiceManager.startAsync(); LOGGER.debug("started application"); }  final ServiceManager addConfiguration(@Nullable final String... configurations); final ServiceManager addConfiguration(final Collection<String> configuration); @SafeVarargs final ServiceManager addModules(final Class<? extends Module>... modules); final ServiceManager addModules(final Collection<Class<? extends Module>> modules); @SafeVarargs final ServiceManager addServices(final Class<? extends Service>... services); final ServiceManager addServices(final Collection<Class<? extends Service>> services); void start(); void stop();  }
@Test public void start() throws Exception { serviceManager.addModules(TestModule.class).addServices(TestService.class).start(); }