title: detect last foreach loop iteration
body: <p>Supposing that I have some <code>foreach</code> loop like this:</p>
  
  <pre><code>Set&lt;String&gt; names = new HashSet&lt;&gt;();
  //some code
  for (String name: names) {
       //some code
  }
  </code></pre>
  
  <p>Is there a way to check inside <code>foreach</code> that the actual name is the last one in <code>Set</code> without a counter?  I didn't found here some question like this.</p>