HashMap<Character, List<Registration>> splitedStudentsByApprovationRatio = splitStudentsByClassification( approvationRatioLimits, otherYearsStudents, "approvationRatio", getApprovationRatioTransformer, setApprovationRatioClosure); ByteArrayOutputStream approvationRatioStream = studentsRenderer( splitedStudentsByApprovationRatio, getApprovationRatioTransformer);
ByteArrayOutputStream approvationRatioStream; ByteArrayOutputStream arithmeticMeanStream; if (otherYearsStudents.size() > 0) { HashMap<Character, List<Registration>> splitedStudentsByApprovationRatio = splitStudentsByClassification( approvationRatioLimits, otherYearsStudents, "approvationRatio", getApprovationRatioTransformer, setApprovationRatioClosure); approvationRatioStream = studentsRenderer( splitedStudentsByApprovationRatio, getApprovationRatioTransformer);
    public ByteArrayOutputStream run(Integer[] entryGradeLimits, Integer[] approvationRatioLimits,            Integer[] arithmeticMeanLimits, Integer degreeCurricularPlanID) throws ExcepcaoPersistencia,            FileNotFoundException {                ExecutionYear currentExecutionYear = ExecutionYear.readCurrentExecutionYear();        List<Registration> otherYearsStudents = new ArrayList<Registration>();        List<Registration> firstYearStudents = new ArrayList<Registration>();        DegreeCurricularPlan degreeCurricularPlan = rootDomainObject.readDegreeCurricularPlanByOID(degreeCurricularPlanID);        List<StudentCurricularPlan> studentCurricularPlans = degreeCurricularPlan                .getStudentCurricularPlans();        for (StudentCurricularPlan studentCurricularPlan : studentCurricularPlans) {            if (studentCurricularPlan.getCurrentState() == StudentCurricularPlanState.ACTIVE) {                Registration registration = studentCurricularPlan.getRegistration();                if (registration.getRegistrationYear() == currentExecutionYear) {                    firstYearStudents.add(registration);                } else {                    registration.calculateApprovationRatioAndArithmeticMeanIfActive(true);                    otherYearsStudents.add(registration);                }            }        }        Arrays.sort(entryGradeLimits);        Arrays.sort(approvationRatioLimits);        Arrays.sort(arithmeticMeanLimits);        ByteArrayOutputStream entryGradeStream;        if (firstYearStudents.size() > 0) {            HashMap<Character, List<Registration>> splitedStudentsByEntryGrade = splitStudentsByClassification(                    entryGradeLimits, firstYearStudents, "entryGrade", getEntryGradeTransformer,                    setEntryGradeClosure);            entryGradeStream = studentsRenderer(splitedStudentsByEntryGrade,                    getEntryGradeTransformer);        } else {            entryGradeStream = new ByteArrayOutputStream();        }        HashMap<Character, List<Registration>> splitedStudentsByApprovationRatio = splitStudentsByClassification(                approvationRatioLimits, otherYearsStudents, "approvationRatio",                getApprovationRatioTransformer, setApprovationRatioClosure);        ByteArrayOutputStream approvationRatioStream = studentsRenderer(                splitedStudentsByApprovationRatio, getApprovationRatioTransformer);        HashMap<Character, List<Registration>> splitedStudentsByArithmeticMean = splitStudentsByClassification(                arithmeticMeanLimits, otherYearsStudents, "arithmeticMean",                getArithmeticMeanTransformer, setArithmeticMeanClosure);        ByteArrayOutputStream arithmeticMeanStream = studentsRenderer(splitedStudentsByArithmeticMean,                getArithmeticMeanTransformer);        return zipResults(entryGradeStream, approvationRatioStream, arithmeticMeanStream);    }