Cycle through array
<p>Supposing I had an array with 4 elements, and I want to cycle through them until a certain condition is met, what would the best way I would have to do so? My idea would be something like:</p>

<pre><code>ArrayList&lt;Player&gt; myList = new ArrayList&lt;Player&gt;();
myList.add(new Player("a"));
myList.add(new Player("b"));
myList.add(new Player("c"));

for(int i = 0; i &lt; 3; i++) {

    if(isGameOver)
         break;

     if(i == 2)
        i = 0;
}
</code></pre>

<p>But I thought that perhaps there was a more elegant solution...</p>
