InfoCurricularCourseScope infoScope1 = (InfoCurricularCourseScope) infoScopes1.get(0); InfoCurricularCourseScope infoScope2 = (InfoCurricularCourseScope) infoScopes2.get(0);
InfoCurricularCourseScope infoScope1 = null; InfoCurricularCourseScope infoScope2 = null; if(infoScopes1.isEmpty()){ return 0; } infoScope1 = (InfoCurricularCourseScope) infoScopes1.get(0); if(infoScopes2.isEmpty()){ return 0; } infoScope2 = (InfoCurricularCourseScope) infoScopes2.get(0);
            public int compare(Object o1, Object o2) {                InfoSiteCourseInformation information1 = (InfoSiteCourseInformation) o1;                InfoSiteCourseInformation information2 = (InfoSiteCourseInformation) o2;                List infoScopes1 = getInfoScopes(information1.getInfoCurricularCourses(),                        infoExecutionDegree);                List infoScopes2 = getInfoScopes(information2.getInfoCurricularCourses(),                        infoExecutionDegree);                ComparatorChain comparatorChain2 = new ComparatorChain();                comparatorChain2.addComparator(new Comparator() {                    public int compare(Object o1, Object o2) {                        InfoCurricularCourseScope infoScope1 = (InfoCurricularCourseScope) o1;                        InfoCurricularCourseScope infoScope2 = (InfoCurricularCourseScope) o2;                        return infoScope1.getInfoCurricularSemester().getInfoCurricularYear().getYear()                                .compareTo(                                        infoScope2.getInfoCurricularSemester().getInfoCurricularYear()                                                .getYear());                    }                });                comparatorChain2.addComparator(new Comparator() {                    public int compare(Object o1, Object o2) {                        InfoCurricularCourseScope infoScope1 = (InfoCurricularCourseScope) o1;                        InfoCurricularCourseScope infoScope2 = (InfoCurricularCourseScope) o2;                        return infoScope1.getInfoCurricularSemester().getSemester().compareTo(                                infoScope2.getInfoCurricularSemester().getSemester());                    }                });                comparatorChain2.addComparator(new Comparator() {                    public int compare(Object o1, Object o2) {                        InfoCurricularCourseScope infoScope1 = (InfoCurricularCourseScope) o1;                        InfoCurricularCourseScope infoScope2 = (InfoCurricularCourseScope) o2;                        if (infoScope1.getInfoBranch().getAcronym() == null                                || infoScope2.getInfoBranch().getAcronym() == null)                            return 0;                        return infoScope1.getInfoBranch().getAcronym().compareTo(                                infoScope2.getInfoBranch().getAcronym());                    }                });                Collections.sort(infoScopes1, comparatorChain2);                Collections.sort(infoScopes2, comparatorChain2);                InfoCurricularCourseScope infoScope1 = (InfoCurricularCourseScope) infoScopes1.get(0);                InfoCurricularCourseScope infoScope2 = (InfoCurricularCourseScope) infoScopes2.get(0);                return comparatorChain2.compare(infoScope1, infoScope2);            }