### Question:
DefaultTimer extends AbstractTimer { @Override public void record(long amount, TimeUnit unit) { if (amount >= 0) { final long nanos = TimeUnit.NANOSECONDS.convert(amount, unit); totalTime.addAndGet(nanos); count.incrementAndGet(); } } DefaultTimer(Clock clock, Id id); @Override Id id(); @Override boolean hasExpired(); @Override void record(long amount, TimeUnit unit); @Override Iterable<Measurement> measure(); @Override long count(); @Override long totalTime();  }### Answer:
@Test public void testRecord() { Timer t = new DefaultTimer(clock, NoopId.INSTANCE); t.record(42, TimeUnit.MILLISECONDS); Assertions.assertEquals(t.count(), 1L); Assertions.assertEquals(t.totalTime(), 42000000L); }
@Test public void testCallable() throws Exception { Timer t = new DefaultTimer(clock, NoopId.INSTANCE); int v2 = t.record(() -> square(42)); }