code: public static ThreadFactory getThreadFactory(String nameFormat, boolean daemon) {
      if (PlatformInformation.isOnGAEStandard7() || PlatformInformation.isOnGAEStandard8()) {
        return MoreExecutors.platformThreadFactory();
      } else {
        return new ThreadFactoryBuilder()
            .setDaemon(daemon)
            .setNameFormat(nameFormat)
            .build();
      }
    }
docs: Get a {@link ThreadFactory} suitable for use in the current environment.
  @param nameFormat to apply to threads created by the factory.
  @param daemon {@code true} if the threads the factory creates are daemon threads, {@code false}
  otherwise.
  @return a {@link ThreadFactory}.