if (evaluation.getEnrollmentStateByGrade() == EnrollmentState.APROVED) {
if (evaluation != null && evaluation.getEnrollmentStateByGrade() == EnrollmentState.APROVED) {
    protected void createCourseStatistics(CourseStatisticsDTO courseStatistics,            List<Enrolment> enrollments) {        int firstEnrolledCount = 0;        int firstApprovedCount = 0;        List<IGrade> firstApprovedGrades = new ArrayList<IGrade>();        int restEnrolledCount = 0;        int restApprovedCount = 0;        List<IGrade> restApprovedGrades = new ArrayList<IGrade>();        int totalEnrolledCount = 0;        int totalApprovedCount = 0;        List<IGrade> totalApprovedGrades = new ArrayList<IGrade>();              for (Enrolment enrollment : enrollments) {        	if(enrollment.isSpecialSeason()) {        		continue;        	}        	totalEnrolledCount++;        	EnrolmentEvaluation evaluation = getBestEnrollmentEvaluation(enrollment);            if (enrollment.isFirstTime()) {                firstEnrolledCount++;                             if (evaluation.getEnrollmentStateByGrade() == EnrollmentState.APROVED) {                    firstApprovedCount++;                    IGrade grade = evaluation.getGradeWrapper();                    firstApprovedGrades.add(grade);                    totalApprovedGrades.add(grade);                    totalApprovedCount++;                }            } else {	            restEnrolledCount++;	            if (evaluation.getEnrollmentStateByGrade() == EnrollmentState.APROVED) {	                restApprovedCount++;	                IGrade grade = evaluation.getGradeWrapper();	                restApprovedGrades.add(grade);	                totalApprovedGrades.add(grade);	                totalApprovedCount++;	            }            }        }                IGrade firstApprovedAverage = calculateApprovedAverage(firstApprovedGrades);        IGrade restApprovedAverage = calculateApprovedAverage(restApprovedGrades);        IGrade totalApprovedAverage = calculateApprovedAverage(totalApprovedGrades);        courseStatistics.setFirstEnrolledCount(firstEnrolledCount);        courseStatistics.setFirstApprovedCount(firstApprovedCount);        courseStatistics.setFirstApprovedAverage(firstApprovedAverage);        courseStatistics.setRestEnrolledCount(restEnrolledCount);        courseStatistics.setRestApprovedCount(restApprovedCount);        courseStatistics.setRestApprovedAverage(restApprovedAverage);        courseStatistics.setTotalEnrolledCount(totalEnrolledCount);        courseStatistics.setTotalApprovedCount(totalApprovedCount);        courseStatistics.setTotalApprovedAverage(totalApprovedAverage);            }