### Question:
DefaultCounter implements Counter { @Override public Iterable<Measurement> measure() { long now = clock.wallTime(); double v = count.get(); return Collections.singleton(new Measurement(id, now, v)); } DefaultCounter(Clock clock, Id id); @Override Id id(); @Override boolean hasExpired(); @Override Iterable<Measurement> measure(); @Override void add(double amount); @Override double actualCount();  }### Answer:
@Test public void testMeasure() { Counter c = new DefaultCounter(clock, NoopId.INSTANCE); c.increment(42); clock.setWallTime(3712345L); for (Measurement m : c.measure()) { Assertions.assertEquals(m.id(), c.id()); Assertions.assertEquals(m.timestamp(), 3712345L); Assertions.assertEquals(m.value(), 42.0, 0.1e-12); } }