}
@Test
public void canSleepUntilClockElapses() {
expect(mockClock.getGranularity()).andReturn(1L).anyTimes();
expect(mockClock.getNanoTime()).andReturn(new DiscreteInterval(4L,5L));
expect(mockClock.getNanoTime()).andReturn(new DiscreteInterval(504L,505L));
expect(mockClock.getNanoTime()).andReturn(new DiscreteInterval(704L,705L));
expect(mockClock.getNanoTime()).andReturn(new DiscreteInterval(1005L,1006L));
replay(mockClock);
impl.set(1000L,100L);
impl.start();
impl.waitUntilElapsed();
verify(mockClock);