@SuppressWarnings("unchecked")
@Test
public void testRegisterGauge() {

  final String gaugeName = "test.guage";
  final List<Integer> l = new ArrayList<Integer>();
  Gauge<Integer> gaugeInst = new Gauge<Integer>() {
    @Override
    public Integer getValue() {
      return l.size();
    }
  };
  gaugeInst = ConduitMetrics.registerGauge(gaugeName, gaugeInst);
  Assert.assertNotNull(gaugeInst);
  Assert.assertEquals(gaugeInst.getValue(), new Integer(0));
  l.add(2);
  Assert.assertEquals(gaugeInst.getValue(), new Integer(1));
  gaugeInst = ConduitMetrics.registerGauge(gaugeName, gaugeInst);
  Assert.assertNull(gaugeInst);
}