@Override
  public long tick() throws InterruptedException {
    long now = mClock.millis();
    mSleeper.sleep(
        () -> Duration.ofMillis(mIntervalSupplier.getNextInterval(mPreviousTickedMs, now)));
    mPreviousTickedMs = mClock.millis();
    return mIntervalSupplier.getRunLimit(mPreviousTickedMs);
  }
@Test
  public void sleepForSpecifiedInterval() throws Exception {
    final SleepingTimer timer =
        new SleepingTimer(THREAD_NAME, mMockLogger, mFakeClock,
            new SteppingThreadSleeper(mMockSleeper, mFakeClock),
            () -> new FixedIntervalSupplier(INTERVAL_MS));
    timer.tick(); // first tick won't sleep
    verify(mMockSleeper, times(0)).sleep(any(Duration.class));
    timer.tick();
    verify(mMockSleeper).sleep(Duration.ofMillis(INTERVAL_MS));
  }