title: How to iterate x times using Java 8 stream?
body: <p>I have an old style <code>for</code> loop to do some load tests:</p>
  
  <pre><code>For (int i = 0 ; i &lt; 1000 ; ++i) {
    if (i+1 % 100 == 0) {
      System.out.println("Test number "+i+" started.");
    }
    // The test itself...
  }
  </code></pre>
  
  <p><strong>How can I use new Java 8 stream API to be able to do this without the <code>for</code>?</strong></p>
  
  <p>Also, the use of the stream would make it easy to switch to parallel stream. <strong>How to switch to parallel stream?</strong></p>
  
  <p>* I'd like to keep the reference to <code>i</code>.</p>