/** * Executes one-shot timer task on shared thread pool. * * @param task timer task to execute * @param delay before executing the task * @param unit of delay * @return a ScheduledFuture representing pending completion of the task * and whose get() method will return null upon completion */ public static ScheduledFuture<?> newTimeout(Runnable task, long delay, TimeUnit unit) { return SharedScheduledExecutors.getPoolThreadExecutor() .schedule(task, delay, unit); }