Timer implements Metered, Sampling { @Override public Snapshot getSnapshot() { return histogram.getSnapshot(); } Timer();  Timer(Reservoir reservoir);  Timer(Reservoir reservoir, Clock clock);  Timer(Meter meter, Histogram histogram, Clock clock); void update(long duration, TimeUnit unit); void update(Duration duration); T time(Callable<T> event); T timeSupplier(Supplier<T> event); void time(Runnable event); Context time(); @Override long getCount(); @Override double getFifteenMinuteRate(); @Override double getFiveMinuteRate(); @Override double getMeanRate(); @Override double getOneMinuteRate(); @Override Snapshot getSnapshot();  }
@Test public void returnsTheSnapshotFromTheReservoir() { final Snapshot snapshot = mock(Snapshot.class); when(reservoir.getSnapshot()).thenReturn(snapshot); assertThat(timer.getSnapshot()) .isEqualTo(snapshot); }