private static void assertValueStartTimeInRangeOverTime(
      TotpCounter counter, long startTime, long duration) {
    for (long time = startTime, endTime = startTime + duration; time <= endTime; time++) {
      long value = counter.getValueAtTime(time);
      long valueStartTime = counter.getValueStartTime(value);
      if ((valueStartTime > time) || (valueStartTime <= time - counter.getTimeStep())) {
        fail("Start time of value " + value + " out of range: time: " + time
            + ", valueStartTime: " + startTime
            + ", timeStep: " + counter.getTimeStep());
      }
    }
  }
Asserts that during the specified time interval the start time of each value from that
interval is not in the future and also is no older than {@code timeStep - 1}.
javatests/com/google/android/apps/authenticator/otp/TotpCounterTest.java