final Set<String> keySet = new HashSet<String>();
// Checks whether the specified json object has all keys defined,
// and whether the type of its value is appropriate
for (int i = 0; i < keysDescription.length(); i++) {
final JSONObject keyDescription = keysDescription.optJSONObject(i);
final String key = keyDescription.optString("name");
keySet.add(key);