### Question:
MicrometerRegistry implements Registry { @Override public Iterator<Meter> iterator() { return impl.getMeters() .stream() .map(this::convert) .filter(Objects::nonNull) .iterator(); } MicrometerRegistry(MeterRegistry impl); @Override Clock clock(); @Override Id createId(String name); @Override Id createId(String name, Iterable<Tag> tags); @Override void register(Meter meter); @Override ConcurrentMap<Id, Object> state(); @Override Counter counter(Id id); @Override DistributionSummary distributionSummary(Id id); @Override Timer timer(Id id); @Override Gauge gauge(Id id); @Override Gauge maxGauge(Id id); @Override Meter get(Id id); @Override Iterator<Meter> iterator();  }### Answer:
@Test public void iterator() { registry.counter("c"); registry.timer("t"); registry.distributionSummary("s"); registry.gauge("g"); Set<String> actual = new HashSet<>(); for (Meter m : registry) { Assertions.assertFalse(m.hasExpired()); actual.add(m.id().name()); } Set<String> expected = new HashSet<>(); expected.add("c"); expected.add("t"); expected.add("s"); expected.add("g"); Assertions.assertEquals(expected, actual); }