Double availablePercentage = getShift().getAvailableShiftPercentageForTeacher( getProfessorship().getTeacher());  if(percentage > availablePercentage) { throw new DomainException("message.exceeded.professorship.percentage"); }
    public DegreeTeachingService(TeacherService teacherService, Professorship professorship,            Shift shift, Double percentage, RoleType roleType) {        super();        if (teacherService == null || professorship == null || shift == null || percentage == null) {            throw new DomainException("arguments can't be null");        }        if (percentage == 0 || percentage > 100 || percentage < 0) {            throw new DomainException("message.invalid.professorship.percentage");        }        setTeacherService(teacherService);        getTeacherService().getExecutionPeriod().checkValidCreditsPeriod(roleType);        setProfessorship(professorship);        setShift(shift);        if (percentage == 100) {            verifyAnyOverLapPeriod();        }        setPercentage(percentage);    }