title: java 8 parallelStream().forEach Result data loss
body: <p>There are two test cases which use <code>parallelStream()</code>:</p>
  <pre><code>List&lt;Integer&gt; src = new ArrayList&lt;&gt;();
  for (int i = 0; i &lt; 20000; i++) {
    src.add(i);
  }
  List&lt;String&gt; strings = new ArrayList&lt;&gt;();
         
  src.parallelStream().filter(integer -&gt; (integer % 2) == 0).forEach(integer -&gt; strings.add(integer + &quot;&quot;));
      
  System.out.println(&quot;=size=&gt;&quot; + strings.size());
  </code></pre>
  <pre><code>=size=&gt;9332
  </code></pre>
  <pre><code>List&lt;Integer&gt; src = new ArrayList&lt;&gt;();
  for (int i = 0; i &lt; 20000; i++) {
    src.add(i);
  }
  List&lt;String&gt; strings = new ArrayList&lt;&gt;();
  
  src.parallelStream().forEach(integer -&gt; strings.add(integer + &quot;&quot;));
  
  System.out.println(&quot;=size=&gt;&quot; + strings.size());
  </code></pre>
  <pre><code>=size=&gt;17908
  </code></pre>
  <p>Why do I always lose data when using parallelStream?
  What did i do wrong?</p>