code: public static ThreadFactory getThreadFactory(String groupName) {
          return new ThreadFactory() {
              final AtomicInteger threadCount = new AtomicInteger();
  
              @Override
              public Thread newThread(Runnable r) {
                  Thread thread = new Thread(r, groupName + "-" + threadCount.incrementAndGet());
                  thread.setDaemon(true);
                  return thread;
              }
          };
      }
docs: Creates and returns a thread factory that will create threads with the given name prefix.
  
  @param groupName the name of the threads
  @return a thread factory