Integer minCapacity = this.getMinimumCapacity(); Integer maxCapacity = this.getMaximumCapacity(); Integer groupMaximumNumber = this.getGroupMaximumNumber();  checkCapacities(shift, students, minCapacity, maxCapacity, groupMaximumNumber);
    public void createStudentGroup(IShift shift, Integer groupNumber, List<IStudent> students) {        if (groupNumber == null || students == null)            throw new NullPointerException();        if (readStudentGroupBy(groupNumber) != null) {            throw new DomainException(this.getClass().getName(), "error.invalidGroupNumber");        }        Integer minCapacity = this.getMinimumCapacity();        Integer maxCapacity = this.getMaximumCapacity();        Integer groupMaximumNumber = this.getGroupMaximumNumber();        checkCapacities(shift, students, minCapacity, maxCapacity, groupMaximumNumber);        checkForStudentsInStudentGroupsAndGrouping(students);        IStudentGroup newStudentGroup = null;        if (shift != null)            newStudentGroup = new StudentGroup(groupNumber, this, shift);        else            newStudentGroup = new StudentGroup(groupNumber, this);        for (IStudent student : students) {            IAttends attend = getStudentAttend(student);            newStudentGroup.addAttends(attend);        }    }