Scheduler implements Closeable { public void scheduleOnce( @NotNull String name, long delay, @NotNull TimeUnit unit, @NotNull Runnable task) { executor.schedule(new SafeRunnable(name, task), delay, unit); } Scheduler(@Nullable String name); void execute(@NotNull String name, @NotNull Runnable task); void scheduleOnce(
            @NotNull String name,
            long delay,
            @NotNull TimeUnit unit,
            @NotNull Runnable task); void scheduleAtFixedRate(
            @NotNull String name,
            long period,
            @NotNull TimeUnit unit,
            @NotNull Runnable task); void scheduleWithFixedDelay(
            @NotNull String name,
            long delay,
            @NotNull TimeUnit unit,
            @NotNull Runnable task); @Override void close();  }
@Test public void scheduleOnce() throws Exception { TestTask task = new TestTask(1); scheduler.scheduleOnce("scheduleOnce", 1, SECONDS, task); assertNull(task.getThreadName()); assertTrue(task.await()); assertEquals("scheduleOnce", task.getThreadName()); }