@Test public void resetsAfterASecond() {

    mockStatic(System.class);
    when(System.nanoTime()).thenReturn(NANOS_PER_SECOND);
    Reservoir reservoir = new Reservoir(10);
    assertTrue(reservoir.take());
    assertFalse(reservoir.take());
    when(System.nanoTime()).thenReturn(NANOS_PER_SECOND + NANOS_PER_DECISECOND);
    assertTrue(reservoir.take());
    assertFalse(reservoir.take());
    when(System.nanoTime()).thenReturn(NANOS_PER_SECOND + NANOS_PER_DECISECOND * 9);
    assertTrue(reservoir.take());
    assertTrue(reservoir.take());
    assertTrue(reservoir.take());
    assertTrue(reservoir.take());
    assertTrue(reservoir.take());
    assertTrue(reservoir.take());
    assertTrue(reservoir.take());
    assertTrue(reservoir.take());
    assertFalse(reservoir.take());
    when(System.nanoTime()).thenReturn(NANOS_PER_SECOND + NANOS_PER_SECOND);
    assertTrue(reservoir.take());
}