title: When to use Guava sameThreadExecutor
body: <p>I just ran into a code like this:</p>
  
  <pre><code>ExecutorService executorService = MoreExecutors.sameThreadExecutor();
  
  for (int i = 0; i &lt; 10; i++) {
    executorService.submit(new Callable&lt;Void&gt;() {
      @Override
      public Void call() throws Exception {
        try {
          Do some work here...
          return null;
        } catch (final Exception e) {
          throw e;
        } finally {
          //
        }
      }
    });
  }
  </code></pre>
  
  <p>Any difference between this and the code snippet below? If I understand it correctly, sameThreadExecutor uses the same thread that calls submit(), which means all these 10 "jobs" are run one by one on the main thread.</p>
  
  <pre><code>for (int i = 0; i &lt; 10; i++) {
        try {
          Do some work here...
        } catch (final Exception e) {
          throw e;
        } finally {
          //
        }
  }
  </code></pre>
  
  <p>Thanks!</p>