CounterCell implements Counter, MetricCell<Long> { @Override public void reset() { dirty.afterModification(); value.set(0L); } CounterCell(MetricName name); @Override void reset(); @Override void inc(long n); @Override void inc(); @Override void dec(); @Override void dec(long n); @Override DirtyState getDirty(); @Override Long getCumulative(); @Override MetricName getName(); @Override boolean equals(@Nullable Object object); @Override int hashCode();  }
@Test public void testReset() { CounterCell counterCell = new CounterCell(MetricName.named("namespace", "name")); counterCell.inc(1); assertThat(counterCell.getCumulative(), equalTo(1L)); counterCell.reset(); assertThat(counterCell.getCumulative(), equalTo(0L)); assertThat(counterCell.getDirty(), equalTo(new DirtyState())); }