final TreeMap<Integer, String> orderedQuestions = Maps.newTreeMap();
orderedQuestions.putAll(request.questions);
for (final Entry<Integer, String> question : orderedQuestions.entrySet()) {
final int pos = question.getKey() - 1;
if (pos < qaPairs.size()) {
final Line qaPair = qaPairs.get(pos);
qaPair.lineNum=question.getKey();
qaPair.question = question.getValue();
//earliestModified = Math.min(earliestModified, pos);
} else {
qaPairs.add(new Line(question.getKey(),question.getValue(), null));
}
}
for (int x = 0; x < qaPairs.size(); x++) {
final Line qaPair = qaPairs.get(x);
qaPair.answer = null;
}
// Remove any qaPairs that have been removed from the browser DOM
if (!orderedQuestions.isEmpty()) {
while (qaPairs.size() > orderedQuestions.lastKey()) {