if (shiftID != null) {
shift = FenixFramework.getDomainObject(shiftID);
}
Set<String> allStudentsUsernames = new HashSet<String>(studentUsernames);
allStudentsUsernames.add(studentUsername);
Integer result = strategy.enrolmentPolicyNewGroup(grouping, allStudentsUsernames.size(), shift);
if (result.equals(Integer.valueOf(-1))) {
throw new InvalidArgumentsServiceException();
}
if (result.equals(Integer.valueOf(-2))) {