code: public static ExecutorService newCachedThreadPool() {
      ThreadPoolExecutor executor =  new ThreadPoolExecutor(
          CORE_POOL_SIZE,
          MAX_POOL_SIZE,
          KEEP_ALIVE_TIME, TimeUnit.SECONDS,
          new LinkedBlockingQueue<Runnable>());
  
      allowCoreThreadTimeout(executor, true);
  
      return executor;
    }
docs: Creates a proper Cached Thread Pool. Tasks will reuse cached threads if available
  or create new threads until the core pool is full. tasks will then be queued. If an
  task cannot be queued, a new thread will be created unless this would exceed max pool
  size, then the task will be rejected. Threads will time out after 1 second.
  
  Core thread timeout is only available on android-9+.
  
  @return the newly created thread pool