code: @Beta
    public static ScheduledExecutorService getExitingScheduledExecutorService(
        ScheduledThreadPoolExecutor executor, long terminationTimeout, TimeUnit timeUnit) {
      return new Application()
          .getExitingScheduledExecutorService(executor, terminationTimeout, timeUnit);
    }
docs: Converts the given ScheduledThreadPoolExecutor into a
  ScheduledExecutorService that exits when the application is complete.  It
  does so by using daemon threads and adding a shutdown hook to wait for
  their completion.
  
  <p>This is mainly for fixed thread pools.
  See {@link Executors#newScheduledThreadPool(int)}.
  
  @param executor the executor to modify to make sure it exits when the
  application is finished
  @param terminationTimeout how long to wait for the executor to
  finish before terminating the JVM
  @param timeUnit unit of time for the time parameter
  @return an unmodifiable version of the input which will not hang the JVM