JmxReporter implements Reporter, Closeable { public void stop() { registry.removeListener(listener); listener.unregisterAll(); } private  JmxReporter(MBeanServer mBeanServer,
                        String domain,
                        MetricRegistry registry,
                        MetricFilter filter,
                        MetricTimeUnits timeUnits,
                        ObjectNameFactory objectNameFactory); static Builder forRegistry(MetricRegistry registry); void start(); void stop(); @Override void close();  }
@Test public void cleansUpAfterItselfWhenStopped() throws Exception { reporter.stop(); try { getAttributes("gauges", "gauge", "Value", "Number"); failBecauseExceptionWasNotThrown(InstanceNotFoundException.class); } catch (InstanceNotFoundException e) { } }