### Question:
ServoCounter implements Counter, ServoMeter { @Override public boolean hasExpired() { long now = clock.wallTime(); return now - lastUpdated.get() > ServoRegistry.EXPIRATION_TIME_MILLIS; } ServoCounter(Id id, Clock clock, DoubleCounter impl); @Override void addMonitors(List<Monitor<?>> monitors); @Override Id id(); @Override boolean hasExpired(); @Override Iterable<Measurement> measure(); @Override void add(double amount); @Override double actualCount();  }### Answer:
@Test public void expiration() { final long initTime = TimeUnit.MINUTES.toMillis(30); final long fifteenMinutes = TimeUnit.MINUTES.toMillis(15); clock.setWallTime(initTime); Counter c = newCounter("foo"); Assertions.assertFalse(c.hasExpired()); c.increment(42); Assertions.assertFalse(c.hasExpired()); clock.setWallTime(initTime + fifteenMinutes); Assertions.assertFalse(c.hasExpired()); clock.setWallTime(initTime + fifteenMinutes + 1); Assertions.assertEquals(c.count(), 42); Assertions.assertTrue(c.hasExpired()); c.increment(); Assertions.assertEquals(c.count(), 43); Assertions.assertFalse(c.hasExpired()); }