title: ExecutorService & Lambdas - difference between .execute(() -> ...) and .execute()
body: <p>I have a class, which implements the <code>Runnable</code> interface, and is a task that once started will run indefinitely (a long-running thread).</p>
  
  <pre class="lang-java prettyprint-override"><code>public class LongRunningTask implements Runnable {
  
      @Override
      public void run() {
          //stuff happening here
      }
  
  }
  </code></pre>
  
  <p>A simple <code>ExecutorService/ThreadPoolExecutor</code> creation:</p>
  
  <pre class="lang-java prettyprint-override"><code>final ExecutorService executorService = Executors.newFixedThreadPool(8);
  </code></pre>
  
  <p>If the <code>LongRunningTask</code> is actually started/executed, I am able to observe the actual result of it, and so, I noticed this:</p>
  
  <ul>
  <li><p>if I pass it to be executed with <code>executorService.execute(() -&gt; new LongRunningTask());</code>, it will not be executed at all, and there won't be a result.</p></li>
  <li><p>if I pass it to be executed with <code>executorService.execute(new LongRunningTask());</code> it will be executed just as it should be and there will be a result.</p></li>
  </ul>
  
  <p>What's the difference when using the lambda syntax of <code>() -&gt;</code>?</p>