Code example for ThreadFactoryBuilder

   * @param defaultParallel  whether to unannotated classes in parallel 
   * @param numThreads       number of parallel threads to use, must be positive. 
  public ConcurrentRunnerScheduler(boolean defaultParallel, int numThreads) {
    this.defaultParallel = defaultParallel;
    ThreadFactory threadFactory = new ThreadFactoryBuilder()
    completionService = new ExecutorCompletionService<Void>(
        Executors.newFixedThreadPool(numThreads, threadFactory));
    concurrentTasks = new LinkedList<Future<Void>>();
    serialTasks = new LinkedList<Runnable>();
  public void schedule(Runnable childStatement) {
Experience pair programming with AI  Get Codota for Java