Histogram implements Metric, Sampling, Counting { @Override public Snapshot getSnapshot() { return reservoir.getSnapshot(); } Histogram(Reservoir reservoir); void update(int value); void update(long value); @Override long getCount(); @Override Snapshot getSnapshot();  }
@Test public void returnsTheSnapshotFromTheReservoir() { final Snapshot snapshot = mock(Snapshot.class); when(reservoir.getSnapshot()).thenReturn(snapshot); assertThat(histogram.getSnapshot()) .isEqualTo(snapshot); }