code: public static ThreadPoolExecutor getBoundedThreadPoolExecutor(int maxPoolSize, long keepAliveTime, TimeUnit unit, ThreadFactory tFactory) {
          return new ThreadPoolExecutor(0, maxPoolSize, keepAliveTime, unit,
                                        new SynchronousQueue<Runnable>(), tFactory);
      }
docs: Create a bounded thread pool executor. The work queue is synchronous and can cause
  RejectedExecutionException if there is no available thread to take a new task.
  @param maxPoolSize: the maximum number of threads to allow in the pool.
  @param keepAliveTime: when the number of threads is greater than the core, this is the maximum
  time that excess idle threads will wait for new tasks before terminating.
  @param unit: the time unit for the keepAliveTime argument.
  @param threadFactory: the factory to use when the executor creates a new thread.