infoLesson.getInfoShiftList().add(infoShift); infoLessonList.add(infoLesson);
if (infoLesson != null) { infoLesson.getInfoShiftList().add(infoShift); infoLessonList.add(infoLesson); }
    public List run(List infoExecutionDegrees, InfoExecutionPeriod infoExecutionPeriod)    {        List infoViewClassScheduleList = new ArrayList();        try        {            ISuportePersistente sp = SuportePersistenteOJB.getInstance();            ITurmaPersistente classDAO = sp.getITurmaPersistente();            ITurnoAulaPersistente shiftLessonDAO = sp.getITurnoAulaPersistente();            // Read executionDegrees classes            List classes = new ArrayList();            for (int i = 0; i < infoExecutionDegrees.size(); i++)            {                List degreeClasses =                    classDAO.readByExecutionDegreeAndExecutionPeriod(                        Cloner.copyInfoExecutionDegree2ExecutionDegree(                            (InfoExecutionDegree) infoExecutionDegrees.get(i)),                        Cloner.copyInfoExecutionPeriod2IExecutionPeriod(infoExecutionPeriod));                Iterator iterator = degreeClasses.iterator();                CollectionUtils.addAll(classes, iterator);            }            for (int i = 0; i < classes.size(); i++)            {                InfoViewClassSchedule infoViewClassSchedule = new InfoViewClassSchedule();                ITurma turma = (ITurma) classes.get(i);                // read class lessons                List shiftList = sp.getITurmaTurnoPersistente().readByClass(turma);                Iterator iterator = shiftList.iterator();                List infoLessonList = new ArrayList();                while (iterator.hasNext())                {                    ITurno shift = (ITurno) iterator.next();                    InfoShift infoShift = (InfoShift) Cloner.get(shift);                    List lessonList = shiftLessonDAO.readByShift(shift);                    Iterator lessonIterator = lessonList.iterator();                    while (lessonIterator.hasNext())                    {                        IAula elem = (IAula) lessonIterator.next();                        InfoLesson infoLesson = Cloner.copyILesson2InfoLesson(elem);                        infoLesson.getInfoShiftList().add(infoShift);                        infoLessonList.add(infoLesson);                    }                }                infoViewClassSchedule.setInfoClass(Cloner.copyClass2InfoClass(turma));                infoViewClassSchedule.setClassLessons(infoLessonList);                infoViewClassScheduleList.add(infoViewClassSchedule);            }        }        catch (ExcepcaoPersistencia ex)        {            ex.printStackTrace();        }        return infoViewClassScheduleList;    }