BeanComparator numberComparator = new BeanComparator("studentCurricularPlan.student.number"); Collections.sort(enrollments, numberComparator);
BeanComparator numberComparator = new BeanComparator("infoStudentCurricularPlan.infoStudent.number");
    private List cleanList(List enrollments, IUserView userView) throws FenixServiceException {        List result = new ArrayList();        Integer numberAux = null;        BeanComparator numberComparator = new BeanComparator("studentCurricularPlan.student.number");        Collections.sort(enrollments, numberComparator);        Iterator iterator = enrollments.iterator();        while (iterator.hasNext()) {            IEnrolment enrolment = (IEnrolment) iterator.next();            if ((numberAux == null)                    || (numberAux.intValue() != enrolment.getStudentCurricularPlan().getStudent()                            .getNumber().intValue())) {                numberAux = enrolment.getStudentCurricularPlan().getStudent().getNumber();                InfoEnrolmentEvaluation infoEnrolmentEvaluation = (new GetEnrolmentGrade()).run(enrolment);                                if (infoEnrolmentEvaluation != null) {                    InfoEnrolment infoEnrolment = InfoEnrolmentWithStudentPlanAndCourseAndExecutionPeriod                            .newInfoFromDomain(enrolment);                    infoEnrolment.setInfoEnrolmentEvaluation(infoEnrolmentEvaluation);                    result.add(infoEnrolment);                }            }        }        return result;    }