}
JSONArray array = (JSONArray) ((JSONObject) object.get("data")).get("children");
// Iterate over the submission results
JSONObject data;
Submission submission;
for (Object anArray : array) {
data = (JSONObject) anArray;
// Make sure it is of the correct kind
String kind = safeJsonToString(data.get("kind"));
if (kind.equals(Kind.LINK.value())) {
// Create and add submission
data = ((JSONObject) data.get("data"));
submission = new Submission(data);
submission.setUser(user);
submissions.add(submission);
}
}