title: Java 8 stream operations execution order
body: <pre><code>List&lt;Integer&gt; numbers = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8);
  List&lt;Integer&gt; twoEvenSquares = numbers.stream().filter(n -&gt; {
      System.out.println("filtering " + n);
      return n % 2 == 0;
  }).map(n -&gt; {
      System.out.println("mapping " + n);
      return n * n;
  }).limit(2).collect(Collectors.toList());
  
  
  for(Integer i : twoEvenSquares)
  {
      System.out.println(i);
  }
  </code></pre>
  
  <p>when executed the logic below output came </p>
  
  <pre><code>filtering 1
  filtering 2
  mapping 2
  filtering 3
  filtering 4
  mapping 4
  4
  16
  </code></pre>
  
  <p>if the stream follows the short circuit concept (where we use limit stream operation), then output must be like below:</p>
  
  <pre><code>filtering 1
  filtering 2
  filtering 3
  filtering 4
  mapping 2
  mapping 4
  4
  16
  </code></pre>
  
  <p>because after filtering 2, we have to still find one more element to stratify limit(2), operation,  so why the output is not coming like I explained?</p>