@Test
public void testReporterNotifications() {

	Configuration config = new Configuration();
	config.setString(MetricOptions.REPORTERS_LIST, "test1,test2");
	config.setString(ConfigConstants.METRICS_REPORTER_PREFIX + "test1." + ConfigConstants.METRICS_REPORTER_CLASS_SUFFIX, TestReporter6.class.getName());
	config.setString(ConfigConstants.METRICS_REPORTER_PREFIX + "test2." + ConfigConstants.METRICS_REPORTER_CLASS_SUFFIX, TestReporter7.class.getName());
	MetricRegistryImpl registry = new MetricRegistryImpl(MetricRegistryConfiguration.fromConfiguration(config));
	TaskManagerMetricGroup root = new TaskManagerMetricGroup(registry, "host", "id");
	root.counter("rootCounter");
	assertTrue(TestReporter6.addedMetric instanceof Counter);
	assertEquals("rootCounter", TestReporter6.addedMetricName);
	assertTrue(TestReporter7.addedMetric instanceof Counter);
	assertEquals("rootCounter", TestReporter7.addedMetricName);
	root.close();
	assertTrue(TestReporter6.removedMetric instanceof Counter);
	assertEquals("rootCounter", TestReporter6.removedMetricName);
	assertTrue(TestReporter7.removedMetric instanceof Counter);
	assertEquals("rootCounter", TestReporter7.removedMetricName);
	registry.shutdown();
}