for (int i = 0; i < getPersonRolesCount(); ) { final Role role = getPersonRoles().get(i); if (!roles.contains(role)) { removePersonRoles(role); } else { i++; } }  for (final Role role : roles) { if (!hasPersonRoles(role)) { addPersonRoles(role); } }
getPersonRoles().retainAll(roles); getPersonRoles().addAll(roles);
    public void indicatePrivledges(final List<Role> roles) {        for (int i = 0; i < getPersonRolesCount(); ) {            final Role role = getPersonRoles().get(i);            if (!roles.contains(role)) {                removePersonRoles(role);            } else {                i++;            }        }        for (final Role role : roles) {            if (!hasPersonRoles(role)) {                addPersonRoles(role);            }        }    }