@Test public void oldDataCleanedWhenIntervalExpired() { IntervalCount intervalCount = new IntervalCount(100L); assertEquals(1L, intervalCount.resetIfExpiredAndTick()); Clock.shift(101); assertEquals(1L, intervalCount.resetIfExpiredAndTick()); }
public long resetIfExpiredAndTick() { if (isExpired()) { reset(); } tick(); return adder.sum(); }
IntervalCount { public long resetIfExpiredAndTick() { if (isExpired()) { reset(); } tick(); return adder.sum(); } }
IntervalCount { public long resetIfExpiredAndTick() { if (isExpired()) { reset(); } tick(); return adder.sum(); } IntervalCount(long intervalDurationMs); }
IntervalCount { public long resetIfExpiredAndTick() { if (isExpired()) { reset(); } tick(); return adder.sum(); } IntervalCount(long intervalDurationMs); long resetIfExpiredAndTick(); long silenceDuration(); long getCount(); }
IntervalCount { public long resetIfExpiredAndTick() { if (isExpired()) { reset(); } tick(); return adder.sum(); } IntervalCount(long intervalDurationMs); long resetIfExpiredAndTick(); long silenceDuration(); long getCount();  }