int approved = 0; Iterator iter = enrolments.iterator(); while (iter.hasNext()) { IEnrolment enrolment = (IEnrolment) iter.next(); EnrollmentState enrollmentState = enrolment.getEnrollmentState(); if (enrollmentState.equals(EnrollmentState.APROVED)) { approved++; }
int approved = 0; Iterator iter = enrolments.iterator(); while (iter.hasNext()) { IEnrolment enrolment = (IEnrolment) iter.next(); EnrollmentState enrollmentState = enrolment.getEnrollmentState(); if (enrollmentState.equals(EnrollmentState.APROVED)) { approved++;
                private Integer getApproved(List enrolments) {                    int approved = 0;                    Iterator iter = enrolments.iterator();                    while (iter.hasNext()) {                        IEnrolment enrolment = (IEnrolment) iter.next();                        EnrollmentState enrollmentState = enrolment.getEnrollmentState();                        if (enrollmentState.equals(EnrollmentState.APROVED)) {                            approved++;                        }                    }                    return new Integer(approved);                }