@Test
public void testRegisterAny() {

	Metric2Registry registry = new Metric2Registry();
	final MetricName     metric1 = MetricName.name("test").build();
	final Gauge<Integer> gauge   = getGauge();
	final Metered        metered = getMetered();
	
	Metric2Set metricSet1 = new Metric2Set() {
		@Override
		public Map<MetricName, Metric> getMetrics() {
			Map<MetricName, Metric> map = new HashMap<MetricName, Metric>(1);
			map.put(metric1, gauge);
			return map;
		}
	};
	Metric2Set metricSet2 = new Metric2Set() {
		@Override
		public Map<MetricName, Metric> getMetrics() {
			Map<MetricName, Metric> map = new HashMap<MetricName, Metric>(1);
			map.put(metric1, metered);
			return map;
		}
	};
	registry.registerAny(metricSet1);
	registry.registerAny(metricSet2);
	
	// first one is registered only
	assertEquals(1, registry.getGauges().entrySet().size());
	assertEquals(0, registry.getMeters().entrySet().size());
	Map.Entry<MetricName, Gauge> stagemonitorEntry = registry.getGauges().entrySet().iterator().next();
	assertEquals("test", stagemonitorEntry.getKey().getName());
	assertEquals(1, 		 stagemonitorEntry.getValue().getValue());
}