ServiceManager { public void stop() { if (internalServiceManager == null) { LOGGER.debug("already stopped"); return; } LOGGER.debug("stopping {} services", services.getResources().size()); internalServiceManager.stopAsync(); lifecycleManager.close(); internalServiceManager = null; LOGGER.debug("stopped {} services", services.getResources().size()); }  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 stop() throws Exception { serviceManager.addModules(TestModule.class).addServices(TestService.class).start(); serviceManager.stop(); }