JmxMetricsService extends AbstractIdleService { @Override protected void shutDown() throws Exception { if (reporter == null) { LOGGER.info("already stopped {}", serviceName()); return; } LOGGER.info("stopping {}", serviceName()); reporter.stop(); reporter = null; LOGGER.info("stopped {}", serviceName()); } @Inject  JmxMetricsService(final MetricRegistry metricRegistry);   }
@Test public void shutDown() throws Exception { jmxMetricsService.shutDown(); }
@Test public void shutDownAlreadyShutDown() throws Exception { jmxMetricsService.shutDown(); jmxMetricsService.shutDown(); }