### Question:
StatelessRegistry extends AbstractRegistry { List<Measurement> getMeasurements() { return stream() .filter(m -> !m.hasExpired()) .flatMap(m -> StreamSupport.stream(m.measure().spliterator(), false)) .collect(Collectors.toList()); } StatelessRegistry(Clock clock, StatelessConfig config); void start(); void stop();  }### Answer:
@Test public void measurementsEmpty() { Assertions.assertEquals(0, registry.getMeasurements().size()); }
@Test public void measurementsWithCounter() { registry.counter("test").increment(); Assertions.assertEquals(1, registry.getMeasurements().size()); }
@Test public void measurementsWithTimer() { registry.timer("test").record(42, TimeUnit.NANOSECONDS); Assertions.assertEquals(4, registry.getMeasurements().size()); }
@Test public void measurementsWithDistributionSummary() { registry.distributionSummary("test").record(42); Assertions.assertEquals(4, registry.getMeasurements().size()); }
@Test public void measurementsWithGauge() { registry.gauge("test").set(4.0); Assertions.assertEquals(1, registry.getMeasurements().size()); }
@Test public void measurementsWithMaxGauge() { registry.maxGauge(registry.createId("test")).set(4.0); Assertions.assertEquals(1, registry.getMeasurements().size()); }