&& (teacherServiceExemption.getType().equals(ServiceExemptionType.SABBATICAL) || teacherServiceExemption.getType().equals( ServiceExemptionType.GRANT_OWNER_EQUIVALENCE_WITHOUT_SALARY) || teacherServiceExemption.getType().equals( ServiceExemptionType.GRANT_OWNER_EQUIVALENCE_WITH_SALARY) || teacherServiceExemption.getType().equals( ServiceExemptionType.GRANT_OWNER_EQUIVALENCE_WITH_SALARY_SABBATICAL) || teacherServiceExemption.getType().equals( ServiceExemptionType.GRANT_OWNER_EQUIVALENCE_WITH_SALARY_WITH_DEBITS) || teacherServiceExemption .getType().equals(ServiceExemptionType.TEACHER_SERVICE_EXEMPTION_E_C_D_U))) {
&& teacherServiceExemption.isServiceExemptionToCountInCredits()) {
    public int getCreditsForServiceExemption(ExecutionPeriod executionPeriod,            TeacherServiceExemption teacherServiceExemption) {        OccupationPeriod occupationPeriod = getLessonsPeriod(executionPeriod);        if (teacherServiceExemption != null                && (teacherServiceExemption.getType().equals(ServiceExemptionType.SABBATICAL)                        || teacherServiceExemption.getType().equals(                                ServiceExemptionType.GRANT_OWNER_EQUIVALENCE_WITHOUT_SALARY)                        || teacherServiceExemption.getType().equals(                                ServiceExemptionType.GRANT_OWNER_EQUIVALENCE_WITH_SALARY)                        || teacherServiceExemption.getType().equals(                                ServiceExemptionType.GRANT_OWNER_EQUIVALENCE_WITH_SALARY_SABBATICAL)                        || teacherServiceExemption.getType().equals(                                ServiceExemptionType.GRANT_OWNER_EQUIVALENCE_WITH_SALARY_WITH_DEBITS) || teacherServiceExemption                        .getType().equals(ServiceExemptionType.TEACHER_SERVICE_EXEMPTION_E_C_D_U))) {            Integer daysBetween = CalendarUtil.getNumberOfDaysBetweenDates(teacherServiceExemption                    .getStart(), teacherServiceExemption.getEnd());            if (occupationPeriod.containsDay(teacherServiceExemption.getStart())) {                if (teacherServiceExemption.getType().equals(ServiceExemptionType.SABBATICAL)) {                    return 6;                } else if (daysBetween > 90) { // to be considered long term                    // grant owner                    return getHoursByCategory(executionPeriod);                }            } else {                occupationPeriod = getLessonsPeriod(executionPeriod.getPreviousExecutionPeriod());                if (occupationPeriod != null                        && occupationPeriod.containsDay(teacherServiceExemption.getStart())                        && daysBetween > 185) { // more than 6 months                    if (teacherServiceExemption.getType().equals(ServiceExemptionType.SABBATICAL)) {                        return 6;                    } else {                        return getHoursByCategory(executionPeriod);                    }                } else {                    if (executionPeriod.containsDay(teacherServiceExemption.getStart())) {                        if (teacherServiceExemption.getType().equals(ServiceExemptionType.SABBATICAL)) {                            return 6;                        } else {                            return getHoursByCategory(executionPeriod);                        }                    } else if (executionPeriod.getPreviousExecutionPeriod().containsDay(                            teacherServiceExemption.getStart())                            && daysBetween > 185) { // more than 6 months                        if (teacherServiceExemption.getType().equals(ServiceExemptionType.SABBATICAL)) {                            return 6;                        } else {                            return getHoursByCategory(executionPeriod);                        }                    }                }            }        }        return 0;    }