}
for (int i = 0; i < json.length(); i++) {
JSONObject subJson = json.getJSONObject(i);
MessagePart child = mp.addChild();
child.setMessage(subJson.optString("message"));
Properties props = (Properties) extractMap(subJson.optJSONObject("properties"), new Properties());
for (Map.Entry entry : props.entrySet()) {
child.addProperty(String.valueOf(entry.getKey()), String.valueOf(entry.getValue()));
}
fillSubMessages(child, subJson.optJSONArray("children"));
}