title: Side-effects in java 8 streams
body: <p>There are several things in Oracle docs that I cannot fully understand:</p>
  
  <pre><code>Operations like forEach and peek are designed for side effects;
  </code></pre>
  
  <p>What they mean by "designed"? What is so special about those two? I can write my code so that any stream API method works via side effect. It's completely up to me, as far as I can understand. What's more, I would usually use peek() to modify the state of the element, not the source itself, which doesn't make it stateful or side-effect-prone.</p>
  
  <p>The javadoc for forEach also says:</p>
  
  <pre><code>The behavior of this operation is explicitly nondeterministic.
  </code></pre>
  
  <p>I understand it when they say the same thing about findAny, but what's non-deterministic about forEach? Any operation in parallel stream cannot guarantee ordering if the stream is not ordered. Why is nondeterminism only mentioned for forEach(and finAny, but it means a bit different thing)?</p>
  
  <p>For peek and forEach javadoc also contains:</p>
  
  <pre><code>action may be performed at whatever time and in whatever thread the library chooses
  </code></pre>
  
  <p>Again, why only there? Why isn't it mentioned for the rest of the operations?</p>