GaugeCell implements Gauge, MetricCell<GaugeData> { @Override public void reset() { dirty.afterModification(); gaugeValue.set(GaugeData.empty()); } GaugeCell(MetricName name); @Override void reset(); @Override void set(long value); @Override DirtyState getDirty(); @Override GaugeData getCumulative(); @Override MetricName getName(); @Override boolean equals(@Nullable Object object); @Override int hashCode();  }
@Test public void testReset() { GaugeCell gaugeCell = new GaugeCell(MetricName.named("namespace", "name")); gaugeCell.set(2); assertThat(gaugeCell.getCumulative().value(), equalTo(GaugeData.create(2).value())); gaugeCell.reset(); assertThat(gaugeCell.getCumulative(), equalTo(GaugeData.empty())); assertThat(gaugeCell.getDirty(), equalTo(new DirtyState())); }