IExamEnrollment examEnrollment = persistentExamEnrollment.readIExamEnrollmentByExam( exam); if (isInDate(examEnrollment)) {
if (isInDate(exam)) {
	public Object run(String username) {		List examsToEnroll = new ArrayList();		List infoExamsEnrolled = new ArrayList();		List infoExamsToEnroll = new ArrayList();		try {			ISuportePersistente sp = SuportePersistenteOJB.getInstance();			IStudent student =				(IStudent) sp.getIPersistentStudent().readByUsername(username);			IPersistentExamEnrollment persistentExamEnrollment =				sp.getIPersistentExamEnrollment();			if (student != null) {				List examsEnrolled = student.getExamsEnrolled();				Iterator iter1 = examsEnrolled.iterator();				while (iter1.hasNext()) {					IExam exam = (IExam) iter1.next();					IExamEnrollment examEnrollment =						persistentExamEnrollment.readIExamEnrollmentByExam(							exam);					if (isInDate(examEnrollment)) {						InfoExam infoExam = Cloner.copyIExam2InfoExam(exam);						infoExam.setInfoExecutionCourse(							Cloner.copyIExecutionCourse2InfoExecutionCourse(								(IDisciplinaExecucao) exam									.getAssociatedExecutionCourses()									.get(									0)));						infoExamsEnrolled.add(infoExam);					}				}				List attends =					sp.getIFrequentaPersistente().readByStudentId(						student.getNumber());				Iterator iter2 = attends.iterator();				while (iter2.hasNext()) {					examsToEnroll.addAll(						((IFrequenta) iter2.next())							.getDisciplinaExecucao()							.getAssociatedExams());				}								CollectionUtils.filter(					examsToEnroll,					new ExamsNotEnrolledPredicate(examsEnrolled));								Iterator iter3 = examsToEnroll.iterator();				while (iter3.hasNext()) {					IExam exam = (IExam) iter3.next();					IExamEnrollment examEnrollment =						persistentExamEnrollment.readIExamEnrollmentByExam(							exam);					if (examEnrollment != null && isInDate(examEnrollment)) {						InfoExam infoExam = Cloner.copyIExam2InfoExam(exam);						infoExam.setInfoExecutionCourse(							Cloner.copyIExecutionCourse2InfoExecutionCourse(								(IDisciplinaExecucao) exam									.getAssociatedExecutionCourses()									.get(									0)));						infoExamsToEnroll.add(infoExam);					}				}			}		} catch (ExcepcaoPersistencia e) {			e.printStackTrace();		}				ISiteComponent component =			new InfoStudentSiteExams(infoExamsToEnroll, infoExamsEnrolled);		SiteView siteView = new SiteView(component);		return siteView;	}