@Test
public void testRegisterCounter() {

  final String counterName = "test.counter";
  final String serviceName = "LocalStreamService";
  final String context = "stream1";
  Counter abCounter = ConduitMetrics.registerCounter(serviceName, counterName, context);
  Assert.assertNotNull(abCounter);
  abCounter = ConduitMetrics.getMetric(serviceName, counterName, context);
  Assert.assertNotNull(abCounter);
  abCounter.inc();
  Assert.assertEquals(abCounter.getCount(), 1);
  abCounter.inc(4);
  Assert.assertEquals(abCounter.getCount(), 5);
  //
  ConduitMetrics.incCounter(serviceName, counterName, context, 9);
  Assert.assertEquals(abCounter.getCount(), 14);
  // trying to register again
  abCounter = ConduitMetrics.registerCounter(serviceName, counterName, context);
  Assert.assertNull(abCounter);
}