@Test
public void samplesClockUntilItTicks() {

    int i = random.nextInt(10) + 2;
    expect(mockEnv.nanoTime()).andReturn(4L).times(i);
    expect(mockEnv.nanoTime()).andReturn(10L);
    replay(mockEnv);
    assertEquals(6L, impl.sampleGranularity());
    verify(mockEnv);
}