List classes = sortClassesByNumberOfCoursesSatisfied(classShifts, courses);
List executionCourses = new ArrayList(); Iterator iter = courses.iterator(); while (iter.hasNext()) { executionCourses.add( Cloner.copyInfoExecutionCourse2ExecutionCourse( (InfoExecutionCourse) iter.next())); }  Comparator classesComparator = new ClassesComparatorByNumberOfCourses(executionCourses); List classes = getClassesFromShifts(classShifts);  Collections.sort(classes, classesComparator);
	private List getStudentsAllowedClasses(IStudent student, ISuportePersistente sp, List courses) throws ExcepcaoPersistencia {		ITurno shiftExample = new Turno();		IDisciplinaExecucao executionCourseExample = new DisciplinaExecucao();		List associatedStudents = new ArrayList();		associatedStudents.add(student);		executionCourseExample.setAttendingStudents(associatedStudents);		shiftExample.setDisciplinaExecucao(executionCourseExample);		//ITurma classExample = new Turma();		ITurmaTurno classShiftExample = new TurmaTurno();		//classShiftExample.setTurma(classExample);		classShiftExample.setTurno(shiftExample);		List classShifts = sp.getITurmaTurnoPersistente().readByCriteria(classShiftExample);		classShifts = removeFullShiftsFromListOfClassShifts(classShifts);		List classes = sortClassesByNumberOfCoursesSatisfied(classShifts, courses);		return getDistinctClassesFromListOfClasses(classes);	}