title: Loop index in java 8
body: <p>Is there a way to use streams to write this code:</p>
  
  <pre><code>    for (int i = 0; i &lt; list.size(); i ++) {
          if (i % 1000 == 0) {
             doSomething();
          }
          doSomethingElse(list.get(i));
     }
  </code></pre>
  
  <p>Thanks!</p>