Replacing a for loop with an iterator in java?
<p>How would I write an iterator for this code?  I want to remove multiple entries based on input.</p>

<pre><code>public void cancelRegistration(String someName)
{
    for (Name n: ArrayList)
    {
        if(n.Name.equals(someName))
        {
            ArrayList.remove(n);
        }
    }
}
</code></pre>
