code: public synchronized void setExecutors(ExecutorService svc) {
          ExecutorService old = this.executors;
          this.executors = svc;
          // gradually executions will be taken over by a new pool
          old.shutdown();
      }
docs: Starts using a new {@link ExecutorService} to carry out executions.
  
  <p>
  The older {@link ExecutorService} will be shut down (but it's still expected to
  complete whatever they are doing and scheduled.)