DefaultDistributionSummary implements DistributionSummary { @Override public void record(long amount) { if (amount >= 0) { totalAmount.addAndGet(amount); count.incrementAndGet(); } } DefaultDistributionSummary(Clock clock, Id id); @Override Id id(); @Override void record(long amount); @Override Indicator measure(); @Override long count(); @Override long totalAmount(); @Override void buckets(long[] buckets);  }
@Test public void testRecord() { DistributionSummary t = new DefaultDistributionSummary(clock, NoopId.INSTANCE); t.record(42); Assert.assertEquals(t.count(), 1L); Assert.assertEquals(t.totalAmount(), 42L); }