result.addAll(curricularCoursesFromOtherAreasToMantain);  if(result.isEmpty() || allTemporary(result)){ result.addAll(getOptionalCourses(result)); } else { IEnrollmentRule enrollmentRule = new PreviousYearsCurricularCourseEnrollmentRule(studentCurricularPlan, executionPeriod); try { result = enrollmentRule.apply(result); } catch (EnrolmentRuleDomainException e) { } } return result;
result.addAll(curricularCoursesFromOtherAreasToMantain);  if (result.isEmpty() || allTemporaryOrNotOptional(result)) { result.addAll(getOptionalCourses(result)); } else { IEnrollmentRule enrollmentRule = new PreviousYearsCurricularCourseEnrollmentRule( studentCurricularPlan, executionPeriod); try { result = enrollmentRule.apply(result); } catch (EnrolmentRuleDomainException e) { } } return result;
    protected List filter(StudentCurricularPlan studentCurricularPlan, ExecutionPeriod executionPeriod,            List curricularCoursesToBeEnrolledIn,            final List selectedCurricularCoursesFromSpecializationAndSecundaryAreas) {        final List curricularCoursesFromCommonAreas = getCommonAreasCurricularCourses(studentCurricularPlan);        List result = (List) CollectionUtils.select(curricularCoursesToBeEnrolledIn, new Predicate() {            public boolean evaluate(Object obj) {                CurricularCourse2Enroll curricularCourse2Enroll = (CurricularCourse2Enroll) obj;                return curricularCoursesFromCommonAreas.contains(curricularCourse2Enroll                        .getCurricularCourse());            }        });        List curricularCoursesFromOtherAreasToMantain = (List) CollectionUtils.select(curricularCoursesToBeEnrolledIn,                new Predicate() {                    public boolean evaluate(Object obj) {                        CurricularCourse2Enroll curricularCourse2Enroll = (CurricularCourse2Enroll) obj;                        return selectedCurricularCoursesFromSpecializationAndSecundaryAreas.contains(curricularCourse2Enroll                                .getCurricularCourse())                                || SpecificLEICEnrollmentRule.this.studentCurricularPlan.getDegreeCurricularPlan().getTFCs()                                        .contains(curricularCourse2Enroll.getCurricularCourse());                    }                });        List specializationAreaCurricularCourses = getSpecializationAreaCurricularCourses(studentCurricularPlan);        List secundaryAreaCurricularCourses = getSecundaryAreaCurricularCourses(studentCurricularPlan);        if (thereIsAnyTemporaryCurricularCourse(studentCurricularPlan,                executionPeriod, specializationAreaCurricularCourses)) {            markCurricularCourses(curricularCoursesFromOtherAreasToMantain,                    specializationAreaCurricularCourses);        }        if (thereIsAnyTemporaryCurricularCourse(studentCurricularPlan, executionPeriod,                secundaryAreaCurricularCourses)) {            markCurricularCourses(curricularCoursesFromOtherAreasToMantain,                    secundaryAreaCurricularCourses);        }        result.addAll(curricularCoursesFromOtherAreasToMantain);        //FIXME        if(result.isEmpty() || allTemporary(result)){        	result.addAll(getOptionalCourses(result));        }        else {        	IEnrollmentRule enrollmentRule = new PreviousYearsCurricularCourseEnrollmentRule(studentCurricularPlan, executionPeriod);        	try {				result = enrollmentRule.apply(result);			} catch (EnrolmentRuleDomainException e) {			}        }        return result;    }