### Question:
ServoRegistry extends AbstractRegistry implements CompositeMonitor<Integer> { @Override public List<Monitor<?>> getMonitors() { List<Monitor<?>> monitors = new ArrayList<>(); for (Meter meter : this) { ServoMeter sm = getServoMeter(meter); if (!meter.hasExpired() && sm != null) { sm.addMonitors(monitors); } } removeExpiredMeters(); return monitors; } ServoRegistry();  ServoRegistry(Clock clock);   ServoRegistry(Clock clock, MonitorConfig config); @Override Integer getValue(); @Override Integer getValue(int pollerIndex); @Override MonitorConfig getConfig(); @Override List<Monitor<?>> getMonitors();  }### Answer:
@Test public void keepNonExpired() { ManualClock clock = new ManualClock(); ServoRegistry registry = Servo.newRegistry(clock); registry.counter("test").increment(); Assertions.assertEquals(1, registry.getMonitors().size()); Assertions.assertEquals(1, registry.counters().count()); }
@Test public void removesExpired() { ManualClock clock = new ManualClock(); ServoRegistry registry = Servo.newRegistry(clock); registry.counter("test").increment(); clock.setWallTime(60000 * 30); Assertions.assertEquals(0, registry.getMonitors().size()); Assertions.assertEquals(0, registry.counters().count()); }
@Test public void resurrectExpiredAndIncrement() { ManualClock clock = new ManualClock(); ServoRegistry registry = Servo.newRegistry(clock); Counter c = registry.counter("test"); clock.setWallTime(60000 * 30); registry.getMonitors(); Assertions.assertTrue(c.hasExpired()); c.increment(); Assertions.assertEquals(1, c.count()); Assertions.assertEquals(1, registry.counter("test").count()); clock.setWallTime(60000 * 60); registry.getMonitors(); Assertions.assertTrue(c.hasExpired()); c.increment(); Assertions.assertEquals(1, c.count()); Assertions.assertEquals(1, registry.counter("test").count()); }