title: java: how many times is the collection expression evaluated in a "foreach"
body: <p>if I do this in Java:</p>
  
  <pre><code>for(String s : myCollection.expensiveListGeneration())
  {
        doSomething();
  }
  </code></pre>
  
  <p>is expensiveListGeneration() invoked just once at the beggining or in every cycle iteration?</p>
  
  <p>Is it implementation dependent?</p>