@Override
  @SuppressWarnings("AndroidJdkLibsChecker")
  public boolean advanceTo(long endTime) {
    if (endTime < SystemClock.uptimeMillis()) {
      return false;
    }
    boolean hasQueueTasks = hasTasksScheduledBefore(endTime);
    shadowOf(looper).idleFor(Duration.ofMillis(endTime - SystemClock.uptimeMillis()));
    return hasQueueTasks;
  }
@Test
  public void advanceTo() {
    assertThat(scheduler.advanceTo(0)).isFalse();

    assertThat(scheduler.advanceTo(SystemClock.uptimeMillis())).isFalse();

    Runnable runnable = mock(Runnable.class);
    new Handler(getMainLooper()).post(runnable);
    verify(runnable, times(0)).run();

    assertThat(scheduler.advanceTo(SystemClock.uptimeMillis())).isTrue();
    verify(runnable, times(1)).run();
  }