How to make modifications on a subset of elements in a list
<p>oldUsers is just a subset of allUsers and all oldUsers are made in-active in the following list. The logic currently works, but I am iterating allUsers just to get the handle of oldUser every time, before I set the active flag to false. Is there a way to pull the appropriate record and make my modifications (oldUsers and allUsers is of type <code>Set&lt;User&gt;</code>)</p>

<pre><code>for (User oldUser : oldUsers) {
    for (User  user : allUsers) {
        if (user.getId().equals(oldUser.getId())) {
            user.setActive(false);
        }
    }
}
</code></pre>
