@Override
  public Future<?> schedule(Executor executor, Runnable command, long delay, TimeUnit unit) {
    requireNonNull(executor);
    requireNonNull(command);
    requireNonNull(unit);

    if (scheduledExecutorService.isShutdown()) {
      return DisabledFuture.INSTANCE;
    }
    return scheduledExecutorService.schedule(() -> {
      try {
        executor.execute(command);
      } catch (Throwable t) {
        logger.log(Level.WARNING, "Exception thrown when submitting scheduled task", t);
        throw t;
      }
    }, delay, unit);
  }
@Test
  public void disabledScheduler() {
    var future = Scheduler.disabledScheduler()
        .schedule(Runnable::run, () -> {}, 1, TimeUnit.MINUTES);
    assertThat(future).isSameInstanceAs(DisabledFuture.INSTANCE);
  }