code: public static void initDefaultPool(int numThreads, boolean isDaemon) {
          if (numThreads == 1) {
              Threads.defaultPool = MoreExecutors.newDirectExecutorService();
              Threads.numThreads = 1;
          } else {
              log.info("Initialized default thread pool to {} threads. (This must be closed by Threads.shutdownDefaultPool)", numThreads);
              Threads.defaultPool = Executors.newFixedThreadPool(numThreads, new ThreadFactory() {
                  public Thread newThread(Runnable r) {
                      Thread t = Executors.defaultThreadFactory().newThread(r);
                      t.setDaemon(isDaemon);
                      return t;
                  }
              });
              Threads.numThreads = numThreads;
              // Shutdown the thread pool on System.exit().
              Runtime.getRuntime().addShutdownHook(new Thread(){
                  @Override
                  public void run() {
                      Threads.shutdownDefaultPool();
                  }
              });
          }
      }
docs: Initializes the default thread pool and adds a shutdown hook which will attempt to shutdown
  the thread pool on a call to System.exit().
  
  If numThreads > 1 and isDaemon = true, then System.exit() or Threads.shutdownDefaultPool()
  must be explicitly called. Otherwise, the JVM may hang.
  
  @param numThreads The number of threads.
  @param isDaemon Whether the thread pool should consist of daemon threads.