Here you can find the source of getExecutorService(int poolSize)
public static ExecutorService getExecutorService(int poolSize)
//package com.java2s; //License from project: Open Source License import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; public class Main { public static ExecutorService getExecutorService(int poolSize) { final ThreadFactory threadFactory = runnable -> { Thread thr = new Thread(runnable); thr.setDaemon(false);/*from w w w . j av a 2s. c om*/ return thr; }; return Executors.newFixedThreadPool(poolSize, threadFactory); } }