title: Is this code threadsafe, using Java 8 Lambdas - stream.forEach
body: <p>Assume that I have a list of book elements:  <code>List&lt;Book&gt; libraryBooks</code> and the following code:</p>
  
  <pre><code>List&lt;BookAuthor&gt; authors = new ArrayList&lt;&gt;();
  libraryBooks.stream().forEach(e -&gt; {
                                       authors.add(createAuthor(e));
                                     });
  </code></pre>
  
  <p>I've looked around and found similar questions, (like <a href="https://stackoverflow.com/questions/50039887/can-a-foreach-lambda-result-in-a-race-condition">here</a>) but I'm not yet convinced.  Because I've been reading a book on the subject and the book seems to indicate that the above could introduce race conditions if the stream was run in parallel - but I'm not using a parallel stream, so is the above subject to race conditions?  Or is the book wrong/misleading?</p>
  
  <p>Here's the excerpt from the book that I'm referring to:
  <a href="https://i.stack.imgur.com/9dHd1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9dHd1.png" alt="enter image description here"></a></p>