@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 warnWhenExecutionTakesLongerThanInterval() throws Exception {
    SleepingTimer timer =
        new SleepingTimer(THREAD_NAME, mMockLogger, mFakeClock,
            new SteppingThreadSleeper(mMockSleeper, mFakeClock),
            () -> new FixedIntervalSupplier(INTERVAL_MS, mMockLogger));

    timer.tick();
    mFakeClock.addTimeMs(5 * INTERVAL_MS);
    timer.tick();

    verify(mMockLogger).warn(anyString(), anyString(), Mockito.anyLong(),
        Mockito.anyLong());
  }