public List run(IUserView userView) throws FenixServiceException { final Person person = userView.getPerson(); if (person == null) { throw new InvalidArgumentsServiceException(); } final List<InfoDegreeCurricularPlan> result = new ArrayList<InfoDegreeCurricularPlan>(); for (final Coordinator coordinator : person.getCoordinatorsSet()) { final ExecutionDegree executionDegree = coordinator.getExecutionDegree(); final DegreeCurricularPlan degreeCurricularPlan = executionDegree.getDegreeCurricularPlan(); if (degreeCurricularPlan.getState() == DegreeCurricularPlanState.ACTIVE) { if (!result.contains(degreeCurricularPlan)) { result.add(InfoDegreeCurricularPlan.newInfoFromDomain(degreeCurricularPlan)); } } } Collections.sort(result, DegreeCurricularPlan.DEGREE_CURRICULAR_PLAN_COMPARATOR_BY_DEGREE_TYPE_AND_EXECUTION_DEGREE_AND_DEGREE_CODE); return result;
public List<InfoDegreeCurricularPlan> run(IUserView userView) throws FenixServiceException { final Person person = userView.getPerson(); if (person == null) { throw new InvalidArgumentsServiceException(); }  final Set<DegreeCurricularPlan> activeDegreeCurricularPlans = new TreeSet<DegreeCurricularPlan>( DegreeCurricularPlan.DEGREE_CURRICULAR_PLAN_COMPARATOR_BY_DEGREE_TYPE_AND_EXECUTION_DEGREE_AND_DEGREE_CODE); for (final Coordinator coordinator : person.getCoordinatorsSet()) { final ExecutionDegree executionDegree = coordinator.getExecutionDegree(); final DegreeCurricularPlan degreeCurricularPlan = executionDegree.getDegreeCurricularPlan(); if (degreeCurricularPlan.getState() == DegreeCurricularPlanState.ACTIVE) { activeDegreeCurricularPlans.add(degreeCurricularPlan); } }  final List<InfoDegreeCurricularPlan> result = new ArrayList<InfoDegreeCurricularPlan>(); for (final DegreeCurricularPlan degreeCurricularPlan : activeDegreeCurricularPlans) { result.add(InfoDegreeCurricularPlan.newInfoFromDomain(degreeCurricularPlan)); }  return result;
    public List run(IUserView userView) throws FenixServiceException {        final Person person = userView.getPerson();        if (person == null) {            throw new InvalidArgumentsServiceException();        }        final List<InfoDegreeCurricularPlan> result = new ArrayList<InfoDegreeCurricularPlan>();        for (final Coordinator coordinator : person.getCoordinatorsSet()) {            final ExecutionDegree executionDegree = coordinator.getExecutionDegree();            final DegreeCurricularPlan degreeCurricularPlan = executionDegree.getDegreeCurricularPlan();            if (degreeCurricularPlan.getState() == DegreeCurricularPlanState.ACTIVE) {                if (!result.contains(degreeCurricularPlan)) {                    result.add(InfoDegreeCurricularPlan.newInfoFromDomain(degreeCurricularPlan));                }            }        }        Collections.sort(result,                DegreeCurricularPlan.DEGREE_CURRICULAR_PLAN_COMPARATOR_BY_DEGREE_TYPE_AND_EXECUTION_DEGREE_AND_DEGREE_CODE);        return result;    }