title: Why does the ExecutorService interface not implement AutoCloseable?
body: <p>Failing to call <code>shutdown()</code> on a thread executor will result in a never terminating application. </p>
  
  <p>Best practice to shut down the ExecutorService is this:</p>
  
  <pre><code>ExecutorService service = null;
  try {
    service = Executors.newSingleThreadExecutor();
    // add tasks to thread executor
    …
  } finally {
    if (service != null) service.shutdown();
  }
  </code></pre>
  
  <p>Since Java knows the try-with-resources concept, wouldn't it be nice if we could do this?</p>
  
  <pre><code>try (service = Executors.newSingleThreadExecutor())
  {
    // add tasks to thread executor
    …
  } 
  </code></pre>