public Integer enrolmentPolicyNewGroup(IGrouping grouping, int numberOfStudentsToEnrole, IShift shift) throws ExcepcaoPersistencia {
public Integer enrolmentPolicyNewGroup(IGrouping grouping, int numberOfStudentsToEnrole, IShift shift) {
    public Integer enrolmentPolicyNewGroup(IGrouping grouping, int numberOfStudentsToEnrole, IShift shift) throws ExcepcaoPersistencia {        if (checkNumberOfGroups(grouping, shift)) {            Integer maximumCapacity = grouping.getMaximumCapacity();            Integer minimumCapacity = grouping.getMinimumCapacity();            Integer nrStudents = Integer.valueOf(numberOfStudentsToEnrole);            if (maximumCapacity == null && minimumCapacity == null)                return Integer.valueOf(1);            if (minimumCapacity != null) {                if (nrStudents.compareTo(minimumCapacity) < 0)                    return Integer.valueOf(-2);            }            if (maximumCapacity != null) {                if (nrStudents.compareTo(maximumCapacity) > 0)                    return Integer.valueOf(-3);            }        } else            return Integer.valueOf(-1);        return Integer.valueOf(1);    }