KamonCounter implements Counter { @Override public boolean reset() { try { final kamon.metric.Counter kamonInternalCounter = getKamonInternalCounter(); if (kamonInternalCounter instanceof kamon.metric.Counter.LongAdder) { ((kamon.metric.Counter.LongAdder) kamonInternalCounter).snapshot(true); LOGGER.trace("Reset counter with name <{}>.", name); return true; } LOGGER.warn("Could not reset counter with name <{}>.", name); return false; } catch (final IllegalStateException e) { LOGGER.warn("Could not reset counter with name <{}>.", name); return false; } } private  KamonCounter(final String name, final Map<String, String> tags); static KamonCounter newCounter(final String name); static KamonCounter newCounter(final String name, final Map<String, String> tags); @Override KamonCounter tag(final String key, final String value); @Override KamonCounter tags(final Map<String, String> tags); @Nullable @Override String getTag(final String key); @Override Map<String, String> getTags(); @Override KamonCounter increment(); @Override KamonCounter increment(final long times); @Override long getCount(); @Override boolean reset(); @Override String toString();  }
@Test public void reset() { assertThat(sut.getCount()).isEqualTo(0); sut.increment(); assertThat(sut.getCount()).isEqualTo(1); sut.reset(); assertThat(sut.getCount()).isEqualTo(0); }