public Question questionAfter(Question current){ int curr = allQuestions.indexOf(current); if(curr != allQuestions.length() - 1){ return allQuestions.get(curr + 1); } //error result -- should never happen if we only call this after isLastQuestion gives the okay else return current; }
public Boolean isLastQuestion(Question current){ int curr = allQuestions.indexOf(current); return curr == allQuestions.length(); }