title: Iterating through a list in reverse order in java
body: <p>I'm migrating a piece of code to make use of generics. One argument for doing so is that the for loop is much cleaner than keeping track of indexes, or using an explicit iterator.</p>
  
  <p>In about half the cases, the list (an ArrayList) is being iterated in reverse order by using an index today.</p>
  
  <p>Can someone suggest a cleaner way of doing this (since I dislike the <code>indexed for loop</code> when working with collections), though it does work?</p>
  
  <pre><code> for (int i = nodes.size() - 1; i &gt;= 0; i--) {
      final Node each = (Node) nodes.get(i);
      ...
   }
  </code></pre>
  
  <p><strong>Note:</strong> I can't add any new dependencies outside the JDK.</p>