@Test
    final void testAdd() {
        final String metricName = "unitTestCounter";
        Counter c = receiver.declareCounter(metricName);
        c.add();
        Bucket b = receiver.getSnapshot();
        final Map<String, List<Entry<Point, UntypedMetric>>> valuesByMetricName = b.getValuesByMetricName();
        assertEquals(1, valuesByMetricName.size());
        List<Entry<Point, UntypedMetric>> x = valuesByMetricName.get(metricName);
        assertEquals(1, x.size());
        assertEquals(Point.emptyPoint(), x.get(0).getKey());
        assertEquals(1L, x.get(0).getValue().getCount());
    }
Functional tests for counters.

@author steinar
container-core/src/test/java/com/yahoo/metrics/simple/CounterTest.java