title: Java sum nested property of partial list using IntStream.range
body: <p>I have this basic code (the list have size greater than 2).</p>
  
  <pre><code>int delayedSamples = 0;
  for (int i = 0; i &lt; list.size() - 2; i++) {
    delayedSamples += list.get(i).getChunk().length / size;
  }
  </code></pre>
  
  <p>Is it possible to replace the before code with <code>IntStream.range</code>? like:</p>
  
  <pre><code>int delayedSamples = IntStream
      .range(0, list.size() - 1)
      .mapToObj(i -&gt; list.get(i).getChunk().length / size).... ??
  </code></pre>
  
  <p>Is there lambda alternative?</p>