int size = specializationAndSecundaryAreaCurricularCoursesToCountForCredits.size(); for (int i = 0; i < size; i++) { CurricularCourse curricularCourse = (CurricularCourse) specializationAndSecundaryAreaCurricularCoursesToCountForCredits .get(i);  Integer curricularCourseCredits = new Integer(curricularCourse.getCredits().intValue());
Integer specCredits = 0; Integer secCredits = 0;
	protected void calculateGroupsCreditsFromEnrollments(StudentCurricularPlan studentCurricularPlan,            List specializationAndSecundaryAreaCurricularCoursesToCountForCredits,            HashMap creditsInScientificAreas, HashMap creditsInSpecializationAreaGroups,            HashMap creditsInSecundaryAreaGroups) {				Integer specCredits = 0;		Integer secCredits = 0;                List specCurricularCourses = getSpecializationAreaCurricularCourses(studentCurricularPlan);        List secCurricularCourses = getSecundaryAreaCurricularCourses(studentCurricularPlan);                optionalCoursesList.addAll(specializationAndSecundaryAreaCurricularCoursesToCountForCredits);        int size = specializationAndSecundaryAreaCurricularCoursesToCountForCredits.size();        for (int i = 0; i < size; i++) {            CurricularCourse curricularCourse = (CurricularCourse) specializationAndSecundaryAreaCurricularCoursesToCountForCredits                    .get(i);                        Integer curricularCourseCredits = new Integer(curricularCourse.getCredits().intValue());            if(specCurricularCourses.contains(curricularCourse)) {            	if(!isSpecAreaDone) {            		specCredits = specCredits + curricularCourseCredits;            		optionalCoursesList.remove(curricularCourse);            		if(isAreaDone(studentCurricularPlan.getBranch().getSpecializationCredits(), specCredits)) {            			isSpecAreaDone = true;            		}            	}                //sumInHashMap(creditsInSpecializationAreaGroups, studentCurricularPlan.getBranch().getIdInternal(), curricularCourseCredits);            } else if(secCurricularCourses.contains(curricularCourse)) {            	if(!isSecAreaDone) {            		secCredits = secCredits + curricularCourseCredits;            		optionalCoursesList.remove(curricularCourse);            		if(isAreaDone(studentCurricularPlan.getSecundaryBranch().getSecondaryCredits(), secCredits)) {            			isSecAreaDone = true;            		}            	}                //sumInHashMap(creditsInSecundaryAreaGroups, studentCurricularPlan.getSecundaryBranch().getIdInternal(), curricularCourseCredits);            }                    }                this.creditsInSecundaryArea = secCredits;        this.creditsInSpecializationArea = specCredits;    }