public static ScheduledExecutorService newSingleScheduledThreadPool() {
        ScheduledExecutorService scheduledExecutorService =
                Executors.newScheduledThreadPool(1);
        OS.addShutdownHook(scheduledExecutorService::shutdown);
        return scheduledExecutorService;
    }
public static ScheduledExecutorService newSingleScheduledThreadPool ( ) { ScheduledExecutorService scheduledExecutorService = Executors . newScheduledThreadPool ( 1 ) ; OS . addShutdownHook ( scheduledExecutorService :: shutdown ) ; return scheduledExecutorService ; }
New single scheduled thread pool scheduled executor service.

@return the scheduled executor service