List<Question> questions = new ArrayList<>();
for (int j = 0; j < 5; j++) {
Question q = new Question();
q.setText("Test question " + i + " - " + j);
List<Answer> answers = new ArrayList<>();
Answer a1 = new Answer();
a1.setCorrect(true);
a1.setText("Correct answer");
Answer a2 = new Answer();
a2.setCorrect(false);
a2.setText("Incorrect answer");
answers.add(a1);
answers.add(a2);
q.setAnswers(answers);
questions.add(q);
}