title: Is there an ExecutorService that uses the current thread?
body: <p>What I am after is a compatible way to configure the use of a thread pool or not. Ideally the rest of the code should not be impacted at all. I could use a thread pool with 1 thread but that isn't quite what I want. Any ideas?</p>
  
  <pre><code>ExecutorService es = threads == 0 ? new CurrentThreadExecutor() : Executors.newThreadPoolExecutor(threads);
  
  // es.execute / es.submit / new ExecutorCompletionService(es) etc
  </code></pre>