@Test public void samplesOnlySpecifiedNumber() {

    mockStatic(System.class);
    when(System.nanoTime()).thenReturn(NANOS_PER_SECOND);
    Reservoir reservoir = new Reservoir(2);
    when(System.nanoTime()).thenReturn(NANOS_PER_SECOND + 1);
    assertTrue(reservoir.take());
    when(System.nanoTime()).thenReturn(NANOS_PER_SECOND + 2);
    assertTrue(reservoir.take());
    when(System.nanoTime()).thenReturn(NANOS_PER_SECOND + 2);
    assertFalse(reservoir.take());
}