throw new IllegalArgumentException("Could not find role[" + roleId + "] to remove LDAP groups from.");
}
role.getLdapGroups().size(); // load them in
for (Integer groupId : groupIds) {
LdapGroup doomedGroup = entityManager.find(LdapGroup.class, groupId);
if (doomedGroup == null) {
throw new IllegalArgumentException("Tried to remove doomedGroup[" + groupId + "] from role["
+ roleId + "], but doomedGroup was not found.");
}
role.removeLdapGroup(doomedGroup);