Degree degree = (Degree) persistentDegree.readByOID(Degree.class, degreeId);
final Degree degree = (Degree) persistentDegree.readByOID(Degree.class, degreeId);
    public List run(Integer degreeId, Integer executionPeriodId) throws FenixServiceException, ExcepcaoPersistencia {            ISuportePersistente ps = PersistenceSupportFactory.getDefaultPersistenceSupport();            IPersistentExecutionPeriod persistentExecutionPeriod = ps.getIPersistentExecutionPeriod();            ICursoPersistente persistentDegree = ps.getICursoPersistente();            final ExecutionPeriod executionPeriod2Compare = (ExecutionPeriod) persistentExecutionPeriod                    .readByOID(ExecutionPeriod.class, executionPeriodId);            if (executionPeriod2Compare == null) {                throw new InvalidArgumentsServiceException();            }            Degree degree = (Degree) persistentDegree.readByOID(Degree.class, degreeId);            if (degree == null) {                throw new InvalidArgumentsServiceException();            }            List<DegreeCurricularPlan> curricularPlans = degree.getDegreeCurricularPlans();            List curricularCourses = new ArrayList();            for (DegreeCurricularPlan degreeCurricularPlan : curricularPlans) {                if (degreeCurricularPlan.getState().equals(DegreeCurricularPlanState.ACTIVE) && degreeCurricularPlan.getCurricularStage().equals(CurricularStage.OLD)) {                    curricularCourses.addAll(degreeCurricularPlan.getCurricularCourses());                }            }            List executionCourses = new ArrayList();            Iterator iter = curricularCourses.iterator();            while (iter.hasNext()) {                CurricularCourse curricularCourse = (CurricularCourse) iter.next();                executionCourses.addAll(CollectionUtils.select(curricularCourse                        .getAssociatedExecutionCourses(), new Predicate() {                    public boolean evaluate(Object arg0) {                        ExecutionCourse executionCourse = (ExecutionCourse) arg0;                        return executionCourse.getExecutionPeriod().equals(executionPeriod2Compare);                    }                }));            }            List infoExecutionCourses = (List) CollectionUtils.collect(executionCourses,                    new Transformer() {                        public Object transform(Object arg0) {                            return InfoExecutionCourse.newInfoFromDomain((ExecutionCourse) arg0);                        }                    });            return infoExecutionCourses;    }