infoSiteStudentsTestMarks .setInfoStudentTestQuestionList(new ArrayList<InfoStudentTestQuestionMark>( infoStudentTestQuestionMarkList.values()));
List infoStudentTestQuestionList = new ArrayList<InfoStudentTestQuestionMark>( infoStudentTestQuestionMarkList.values()); Collections.sort(infoStudentTestQuestionList, new BeanComparator("studentNumber")); infoSiteStudentsTestMarks.setInfoStudentTestQuestionList(infoStudentTestQuestionList);
    public InfoSiteStudentsTestMarks run(Integer executionCourseId, Integer distributedTestId, String path)            throws FenixServiceException, ExcepcaoPersistencia {        InfoSiteStudentsTestMarks infoSiteStudentsTestMarks = new InfoSiteStudentsTestMarks();        DistributedTest distributedTest = rootDomainObject.readDistributedTestByOID(distributedTestId);        if (distributedTest == null) {            throw new InvalidArgumentsServiceException();        }        Set<StudentTestQuestion> studentTestQuestionList = distributedTest                .getStudentTestQuestionsSortedByStudentNumberAndTestQuestionOrder();        HashMap<Integer, InfoStudentTestQuestionMark> infoStudentTestQuestionMarkList = new HashMap<Integer, InfoStudentTestQuestionMark>();        for (StudentTestQuestion studentTestQuestion : studentTestQuestionList) {            if (infoStudentTestQuestionMarkList                    .containsKey(studentTestQuestion.getStudent().getNumber())) {                InfoStudentTestQuestionMark infoStudentTestQuestionMark = infoStudentTestQuestionMarkList                        .get(studentTestQuestion.getStudent().getNumber());                ParseSubQuestion parse = new ParseSubQuestion();                Question question = studentTestQuestion.getQuestion();                try {                    question = parse.parseSubQuestion(studentTestQuestion.getQuestion(), path.replace(                            '\\', '/'));                } catch (Exception e) {                    throw new FenixServiceException(e);                }                if (studentTestQuestion.getItemId() != null                        && !studentTestQuestion.getItemId().equals(                                question.getSubQuestions().get(0).getItemId())) {                    infoStudentTestQuestionMark.addTestQuestionMark(infoStudentTestQuestionMark                            .getTestQuestionMarks().size() - 1, studentTestQuestion                            .getTestQuestionMark());                } else {                    infoStudentTestQuestionMark.addTestQuestionMark(studentTestQuestion                            .getTestQuestionMark());                }                infoStudentTestQuestionMark.addToMaximumMark(studentTestQuestion.getTestQuestionValue());            } else {                infoStudentTestQuestionMarkList.put(studentTestQuestion.getStudent().getNumber(),                        InfoStudentTestQuestionMark.newInfoFromDomain(studentTestQuestion));            }        }        // List<InfoStudentTestQuestionMark> infoStudentTestQuestionList =        // (List<InfoStudentTestQuestionMark>) CollectionUtils        // .collect(studentTestQuestionList, new Transformer() {        //        // public Object transform(Object arg0) {        // StudentTestQuestion studentTestQuestion = (StudentTestQuestion) arg0;        // return        // InfoStudentTestQuestionMark.newInfoFromDomain(studentTestQuestion);        // }        //        // });        // infoSiteStudentsTestMarks.setMaximumMark(distributedTest.calculateMaximumDistributedTestMark());        infoSiteStudentsTestMarks                .setInfoStudentTestQuestionList(new ArrayList<InfoStudentTestQuestionMark>(                        infoStudentTestQuestionMarkList.values()));        infoSiteStudentsTestMarks.setExecutionCourse(InfoExecutionCourse                .newInfoFromDomain((ExecutionCourse) distributedTest.getTestScope().getDomainObject()));        infoSiteStudentsTestMarks.setInfoDistributedTest(InfoDistributedTest                .newInfoFromDomain(distributedTest));        return infoSiteStudentsTestMarks;    }