GraphiteMetricsService extends AbstractIdleService { @Override protected void shutDown() throws Exception { if (reporter == null) { LOGGER.info("already stopped {}, service: {}, prefix: {}, interval: {}", serviceName(), service, prefix, interval); return; } LOGGER.info("stopping {}, service: {}, prefix: {}, interval: {}", serviceName(), service, prefix, interval); reporter.stop(); reporter = null; LOGGER.info("stopped {}, service: {}, prefix: {}, interval: {}", serviceName(), service, prefix, interval); } @Inject  GraphiteMetricsService(@Named("metrics.graphite.service") final URI service,
                                  @Named("metrics.graphite.service.prefix") final String prefix,
                                  @Named("metrics.graphite.interval.seconds") final int interval,
                                  final MetricRegistry metricRegistry);   }
@Test public void shutDown() throws Exception { graphiteMetricsService.shutDown(); }
@Test public void shutDownAlreadyShutDown() throws Exception { graphiteMetricsService.shutDown(); graphiteMetricsService.shutDown(); }