### Question:
MicrometerRegistry implements Registry { @Override public Gauge maxGauge(Id id) { StepDouble value = new StepDouble(Double.NaN, clock(), 60000L); io.micrometer.core.instrument.Gauge gauge = io.micrometer.core.instrument.Gauge .builder(id.name(), value, StepDouble::poll) .tags(convert(id.tags())) .register(impl); return new MicrometerGauge(id, v -> value.getCurrent().max(v), gauge); } 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 maxGaugeSet() { Gauge g = registry.maxGauge("foo"); Assertions.assertTrue(Double.isNaN(g.value())); g.set(42.0); g.set(20.0); clock.addSeconds(60); Assertions.assertEquals(42.0, g.value(), 1e-12); }