if((professorship != null) && (professorShiftId != null) && (professorShiftId.intValue() > 0)){ IPersistentResponsibleFor persistentResponsibleFor = persistentSuport.getIPersistentResponsibleFor(); IResponsibleFor responsibleFor = persistentResponsibleFor.readByTeacherAndExecutionCourse(professorship.getTeacher().getIdInternal(), executionCourseId);  if (responsibleFor != null) { List summariesByTeacher = persistentSummary.readByOtherTeachers(executionCourseId);  if (summaries != null) { summaries = (List) CollectionUtils.union(summaries, summariesByTeacher); } else { summaries = summariesByTeacher;
if ((professorship != null) && (professorShiftId != null) && (professorShiftId.intValue() > 0)) { IPersistentResponsibleFor persistentResponsibleFor = persistentSuport .getIPersistentResponsibleFor(); IResponsibleFor responsibleFor = persistentResponsibleFor.readByTeacherAndExecutionCourse( professorship.getTeacher().getIdInternal(), executionCourseId);  if (responsibleFor != null) { List<ISummary> summariesByTeacher = persistentSummary.readByOtherTeachers(executionCourseId);  if (summaryType != null && !summaryType.equals("0")) { ShiftType sumaryType = ShiftType.valueOf(summaryType);  List summariesAux = new ArrayList(); for(ISummary summary : summariesByTeacher){ if(summary.getSummaryType().equals(sumaryType)) summariesAux.add(summary); }  if (summaries != null) summaries = (List) CollectionUtils.union(summaries, summariesAux); else summaries = summariesAux; } else { if (summaries != null) summaries = (List) CollectionUtils.union(summaries, summariesByTeacher); else summaries = summariesByTeacher;
    protected List readSummariesOfOtherTeachersIfResponsible(Integer executionCourseId, Integer professorShiftId, ISuportePersistente persistentSuport, IPersistentSummary persistentSummary, List summaries, List<IProfessorship> professorships) throws ExcepcaoPersistencia {        IProfessorship professorship = getProfessorship(professorShiftId, professorships);                if((professorship != null) && (professorShiftId != null) && (professorShiftId.intValue() > 0)){            IPersistentResponsibleFor persistentResponsibleFor = persistentSuport.getIPersistentResponsibleFor();            IResponsibleFor responsibleFor = persistentResponsibleFor.readByTeacherAndExecutionCourse(professorship.getTeacher().getIdInternal(), executionCourseId);                                if (responsibleFor != null) {                            List summariesByTeacher = persistentSummary.readByOtherTeachers(executionCourseId);                    if (summaries != null) {                    summaries = (List) CollectionUtils.union(summaries, summariesByTeacher);                } else {                    summaries = summariesByTeacher;                }            }        }        return summaries;    }