Every ScheduledThreadPoolExecutor created by {@link Executors} is wrapped. Also,
{@link Executors#newSingleThreadExecutor()} wrap a regular {@link ThreadPoolExecutor}.
353785
@Nullable
    private ThreadPoolExecutor unwrapThreadPoolExecutor(ExecutorService executor, Class<?> wrapper) {
        try {
            Field e = wrapper.getDeclaredField("e");
            e.setAccessible(true);
            return (ThreadPoolExecutor) e.get(executorService);
        } catch (NoSuchFieldException | IllegalAccessException e) {
            // Do nothing. We simply can't get to the underlying ThreadPoolExecutor.
        }
        return null;
    }
1344899
public static Concurrency with(final Executor executor) {
		if (executor instanceof ForkJoinPool) {
			return new ForkJoinPoolConcurrency((ForkJoinPool)executor);
		} else if (executor instanceof ExecutorService) {
			return new ExecutorServiceConcurrency((ExecutorService)executor);
		} else if (executor == SERIAL_EXECUTOR) {
			return SERIAL_EXECUTOR;
		} else {
			return new ExecutorConcurrency(executor);
		}
	}
423733
public static ExecutorService startWithExecutorService(String message,
            Runnable runnable) {
        return startWithExecutorService(newThreadPoolWithAvailableProcessors(),
                message, runnable);
    }
969936
protected ScheduledExecutorService createExecutor(ThreadFactory threadFactory)
    {
        ThreadFactory factory = threadFactory == null
            ? DEFAULT_THREAD_FACTORY
            : threadFactory;

        return Executors.newSingleThreadScheduledExecutor(factory);
    }
1290425
protected Runnable wrapTask(Runnable command) {
    final Callable<Object> wrapped = wrapTask(Executors.callable(command, null));
    return new Runnable() {
      @Override
      public void run() {
        try {
          wrapped.call();
        } catch (Exception e) {
          throwIfUnchecked(e);
          throw new RuntimeException(e);
        }
      }
    };
  }
821534
def executor(self) -> "ThreadPoolExecutor":
        
        if not isinstance(self.__executor, ThreadPoolExecutor) or self.__executor.is_shutdown:
            self.configure()
        return self.__executor
567984
public static ThreadPoolExecutor newFixedThreadPool(int corePoolSize) {
        return new ThreadPoolExecutor(corePoolSize,
            corePoolSize,
            0,
            TimeUnit.MILLISECONDS,
            new SynchronousQueue<Runnable>());
    }
460136
protected ThreadFactory getThreadFactory() {
        return new ThreadFactory() {
            private final ThreadFactory parent = Executors.defaultThreadFactory();
            private final AtomicInteger tid = new AtomicInteger(1);

            @Override
            public Thread newThread(final Runnable task) {
              final Thread t = parent.newThread(task);
              t.setName(THREAD_PREFIX + tid.getAndIncrement());
              return t;
            }
          };
    }
778611
public static ThreadPoolExecutor createDefaultExecutorService() {
        ThreadFactory threadFactory = new ThreadFactory() {
            private int threadCount = 1;

            public Thread newThread(Runnable r) {
                Thread thread = new Thread(r);
                thread.setName("s3-transfer-manager-worker-" + threadCount++);
                return thread;
            }
        };
        return (ThreadPoolExecutor)Executors.newFixedThreadPool(10, threadFactory);
    }
855630
public static ScheduledExecutorService createScheduler() {
		final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1, new DaemonThreadFactory(DEFAULT_SCHEDULER_NAME));
		SCHEDULERS.add(scheduler);
		return scheduler;
	}
442337
@Nonnull
    public static synchronized ScheduledExecutorService get() {
        if (executorService == null) {
            // corePoolSize is set to 10, but will only be created if needed.
            // ScheduledThreadPoolExecutor "acts as a fixed-sized pool using corePoolSize threads"
            // TODO consider also wrapping in ContextResettingExecutorService
             executorService = new ImpersonatingScheduledExecutorService(new ErrorLoggingScheduledThreadPoolExecutor(10, new NamingThreadFactory(new ClassLoaderSanityThreadFactory(new DaemonThreadFactory()), "jenkins.util.Timer")), ACL.SYSTEM);
        }
        return executorService;
    }
1049108
ThreadPoolExecutor createExecutor(final String threadPrefix, final int workerCount, int queueSize) {
		ThreadFactory threadFactory = new ThreadFactory() {
			private int counter = 0;
			@Override
			public Thread newThread(Runnable runnable) {
				return new Thread(runnable, threadPrefix + "-" + ++counter);
			}
		};
		ThreadPoolExecutor executor = new ThreadPoolExecutor(workerCount, workerCount,
				0, TimeUnit.SECONDS,
				new LinkedBlockingQueue<Runnable>(queueSize), threadFactory);
		return executor;
	}
585189
public static ExecutorService getSingleThreadExecutor(String name) {
        ExecutorService ste =
                new ThreadPoolExecutor(1, 1,
                        0L, TimeUnit.MILLISECONDS,
                        new LinkedBlockingQueue<Runnable>(),
                        CoreUtils.getThreadFactory(null, name, SMALL_STACK_SIZE, false, null));
        return ste;
    }
398413
@Override
    public ExecutorService newSingleThreadExecutorService() {

        // create new single thread executor service
        ExecutorService singleThreadExecutorService = Executors.newSingleThreadExecutor(getThreadFactory("pi4j-single-executor-%d"));

        // add new instance to managed collection
        singleThreadExecutorServices.add(singleThreadExecutorService);

        // return new executor service
        return singleThreadExecutorService;
    }
734533
private static ThreadPoolExecutor createChunkDownloaderExecutorService(
      final String threadNamePrefix, final int parallel)
  {
    ThreadFactory threadFactory = new ThreadFactory()
    {
      private int threadCount = 1;

      public Thread newThread(final Runnable r)
      {
        final Thread thread = new Thread(r);
        thread.setName(threadNamePrefix + threadCount++);

        thread.setUncaughtExceptionHandler(
            new Thread.UncaughtExceptionHandler()
            {
              public void uncaughtException(Thread t, Throwable e)
              {
                logger.error(
                    "uncaughtException in thread: " + t + " {}",
                    e);
              }
            });

        thread.setDaemon(true);

        return thread;
      }
    };
    return (ThreadPoolExecutor) Executors.newFixedThreadPool(parallel,
                                                             threadFactory);
  }
673031
public synchronized static ExecutorService getExecutorService() {
        if (executorService == null) {
            executorService = Executors.newCachedThreadPool();
            ((ThreadPoolExecutor) executorService).setMaximumPoolSize(executorPoolSize);
        }
        return executorService;
    }
926027
@EachBean(ExecutorConfiguration.class)
    @Bean(preDestroy = "shutdown")
    public ExecutorService executorService(ExecutorConfiguration executorConfiguration) {
        ExecutorType executorType = executorConfiguration.getType();
        switch (executorType) {
            case FIXED:
                return executorConfiguration
                    .getThreadFactoryClass()
                    .flatMap(InstantiationUtils::tryInstantiate)
                    .map(factory -> Executors.newFixedThreadPool(executorConfiguration.getNumberOfThreads(), factory))
                    .orElse(Executors.newFixedThreadPool(executorConfiguration.getNumberOfThreads(), threadFactory));

            case CACHED:
                return executorConfiguration
                    .getThreadFactoryClass()
                    .flatMap(InstantiationUtils::tryInstantiate)
                    .map(Executors::newCachedThreadPool)
                    .orElse(Executors.newCachedThreadPool(threadFactory));

            case SCHEDULED:
                return executorConfiguration
                    .getThreadFactoryClass()
                    .flatMap(InstantiationUtils::tryInstantiate)
                    .map(factory -> Executors.newScheduledThreadPool(executorConfiguration.getCorePoolSize(), factory))
                    .orElse(Executors.newScheduledThreadPool(executorConfiguration.getCorePoolSize(), threadFactory));

            case WORK_STEALING:
                return Executors.newWorkStealingPool(executorConfiguration.getParallelism());

            default:
                throw new IllegalStateException("Could not create Executor service for enum value: " + executorType);
        }
    }