title: How to apply some changes to each element in List<List<>> structure using Java 8 approach
body: <p>I have some structure like  <code>List&lt;List&lt;Double&gt;&gt; listOfDoubles</code> I need to transform it to <code>List&lt;List&lt;Integer&gt;&gt; listOfInteger</code>. I wrote code without using Java 8. And it looks like:</p>
  
  <pre><code>List&lt;List&lt;Integer&gt;&gt; integerList = new ArrayList&lt;&gt;();
  for (int i = 0; i &lt; doubleList.size(); i++) {
      for (Double doubleValue : doubleList.get(i)) {
          integerList.get(i).add(doubleValue.intValue());
      }
  }
  </code></pre>
  
  <p>I tried to replace second <code>for</code> by <code>foreach</code> but can't because <code>i</code> should be final. How to write this code using Java 8 approach?</p>