### Question:
MicrometerRegistry implements Registry { @Override public DistributionSummary distributionSummary(Id id) { return new MicrometerDistributionSummary(id, impl.summary(id.name(), convert(id.tags()))); } 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 summaryRecord() { DistributionSummary s = registry.distributionSummary("foo"); Assertions.assertEquals(0, s.count()); Assertions.assertEquals(0, s.totalAmount()); s.record(42); Assertions.assertEquals(1, s.count()); Assertions.assertEquals(42, s.totalAmount()); }
@Test public void summaryMeasure() { DistributionSummary s = registry.distributionSummary("foo"); s.record(42); int i = 0; for (Measurement m : s.measure()) { ++i; Assertions.assertEquals("foo", m.id().name()); switch (Utils.getTagValue(m.id(), "statistic")) { case "count": Assertions.assertEquals(1.0, m.value(), 1e-12); break; case "total": Assertions.assertEquals(42.0, m.value(), 1e-12); break; case "max": Assertions.assertEquals(42.0, m.value(), 1e-12); break; default: Assertions.fail("invalid statistic for measurment: " + m); } } Assertions.assertEquals(3, i); }