if (order == null || studentTestQuestion.getTestQuestionOrder().equals(order)) { if (responded && studentTestQuestion.getResponse() != null) { count++; } else if (!responded && studentTestQuestion.getResponse() == null) { count++; }
if (studentTestQuestion.getTestQuestionOrder().equals(order) && studentTestQuestion.getResponse().equals(response)) { count++;
    public int countResponses(final Integer order, final boolean responded) {        int count = 0;        for (final StudentTestQuestion studentTestQuestion : getDistributedTestQuestionsSet()) {            if (order == null || studentTestQuestion.getTestQuestionOrder().equals(order)) {                if (responded && studentTestQuestion.getResponse() != null) {                    count++;                } else if (!responded && studentTestQuestion.getResponse() == null) {                    count++;                }            }        }        return count;    }