Metadata metadata = question.getMetadata();
    public List<LabelValueBean> run(Integer executionCourseId, Integer questionCode) throws ExcepcaoPersistencia, InvalidArgumentsServiceException {        List<LabelValueBean> result = new ArrayList<LabelValueBean>();        Question question = rootDomainObject.readQuestionByOID(questionCode);        if (question == null) {            throw new InvalidArgumentsServiceException();        }        for (StudentTestQuestion studentTestQuestion : question.getStudentTestsQuestions()) {            if (compareDates(studentTestQuestion.getDistributedTest().getEndDate(), studentTestQuestion.getDistributedTest().getEndHour())) {                result.add(new LabelValueBean(studentTestQuestion.getDistributedTest().getTitle(), studentTestQuestion.getStudent().getNumber()                        .toString()));            }        }        if (result.size() == 0) {            Question newQuestion = getNewQuestion(question);            for (TestQuestion testQuestion : question.getTestQuestions()) {                if (newQuestion == null) {                    testQuestion.getTest().deleteTestQuestion(testQuestion);                } else {                    testQuestion.setQuestion(getNewQuestion(question));                }            }            Metadata metadata = question.getMetadata();            if (question.getStudentTestsQuestions() == null || question.getStudentTestsQuestions().size() == 0) {                question.delete();                if (metadata.getQuestionsCount() <= 1) {                    metadata.delete();                } else if (metadata.getVisibleQuestions().size() == 0) {                    metadata.setVisibility(Boolean.FALSE);                }            } else {                if (metadata.getVisibleQuestions().size() <= 1) {                    metadata.setVisibility(Boolean.FALSE);                }                question.setVisibility(Boolean.FALSE);            }        }        return result;    }