code: protected ExecutorService initializeExecutor(ThreadFactory threadFactory,
              RejectedExecutionHandler rejectedExecutionHandler) {
          this.scheduledExecutor = createExecutor(this.poolSize, threadFactory, rejectedExecutionHandler);
          if (this.removeOnCancelPolicy) {
              if (setRemoveOnCancelPolicyAvailable && this.scheduledExecutor instanceof ScheduledThreadPoolExecutor) {
                  ((ScheduledThreadPoolExecutor) this.scheduledExecutor).setRemoveOnCancelPolicy(true);
              } else {
                  // logger.info("Could not apply remove-on-cancel policy - not a Java 7+ ScheduledThreadPoolExecutor");
              }
          }
          return this.scheduledExecutor;
      }
docs: Initialize executor.
  
  @param threadFactory the thread factory
  @param rejectedExecutionHandler the rejected execution handler
  @return the executor service