int receivedRecords = request.getPageSize();
while (receivedRecords < request.getLimit() &&
(receivedRecords + request.getStart() - 1) < queryResponse.getTotalResultCount()) {
QueryRequest pageRequest = request.clone();
pageRequest.setStart(receivedRecords + request.getStart());
QueryResponse pageResponse = new QueryResponse(client.doGet(pageRequest.toUrl()));
if (pageResponse.wasSuccessful()) {
JsonArray results = queryResponse.getResults();
results.addAll(pageResponse.getResults());
receivedRecords += pageRequest.getPageSize();
}