IEnrolment enrollment = (IEnrolment) enrollments.get(i);
IEnrollment enrollment = (IEnrollment) enrollments.get(i);
    public List apply(List curricularCoursesToBeEnrolledIn) {        double maxEnrolledCurricularCourses = 0;        double numberOfEnrolledCurricularCourses = 0;        double availableCurricularCoursesToEnroll = 0;        ArrayList filterCurricularCoursesToBeEnrolledIn = new ArrayList();                       for(int i = 0; i < enrollments.size(); i++){            IEnrolment enrollment = (IEnrolment) enrollments.get(i);            numberOfEnrolledCurricularCourses += enrollment.getCurricularCourse().getEnrollmentWeigth().doubleValue();        }		availableCurricularCoursesToEnroll = maxEnrolledCurricularCourses - numberOfEnrolledCurricularCourses;         		curricularCoursesToBeEnrolledIn = sortCurricularCourseByCurricularYear(curricularCoursesToBeEnrolledIn);        curricularCoursesToBeEnrolledIn = filterCurricularCoursesThatExeceedAcumulatedValue(curricularCoursesToBeEnrolledIn);		        for(int i = 0; i < enrollments.size(); i++){            ICurricularCourse curricularCourse = (ICurricularCourse) curricularCoursesToBeEnrolledIn.get(i);            if(curricularCourse.getWeigth().doubleValue() > availableCurricularCoursesToEnroll)            	filterCurricularCoursesToBeEnrolledIn.add(curricularCourse);        }                curricularCoursesToBeEnrolledIn.removeAll(filterCurricularCoursesToBeEnrolledIn);        return curricularCoursesToBeEnrolledIn;    }