IEnrolment enrollment = (IEnrolment) this.studentCurricularPlan.getStudentEnrolledEnrollments().get(i);
IEnrollment enrollment = (IEnrollment) this.studentCurricularPlan.getStudentEnrolledEnrollments().get(i);
	public List apply(List curricularCoursesToBeEnrolledIn)	{		List curricularCoursesToRemove = new ArrayList();		int totalNAC = 0;		int size = this.studentCurricularPlan.getStudentEnrolledEnrollments().size();		for(int i = 0; i < size; i++)        {            IEnrolment enrollment = (IEnrolment) this.studentCurricularPlan.getStudentEnrolledEnrollments().get(i);            ICurricularCourse curricularCourse = enrollment.getCurricularCourse();            totalNAC += this.studentCurricularPlan.getCurricularCourseAcumulatedEnrolments(curricularCourse).intValue();        }				int maxNAC = this.studentCurricularPlan.getMaximumNumberOfAcumulatedEnrollments().intValue();				if (totalNAC >= maxNAC)		{			return new ArrayList();		}		int availableNACToEnroll = maxNAC - totalNAC;		size = curricularCoursesToBeEnrolledIn.size();		for(int i = 0; i < size; i++)        {            ICurricularCourse curricularCourse = (ICurricularCourse) curricularCoursesToBeEnrolledIn.get(i);            int ac = this.studentCurricularPlan.getCurricularCourseAcumulatedEnrolments(curricularCourse).intValue();            if (ac > availableNACToEnroll)            {            	curricularCoursesToRemove.add(curricularCourse);            }        }		curricularCoursesToBeEnrolledIn.removeAll(curricularCoursesToRemove);		return curricularCoursesToBeEnrolledIn;	}