public static HashMap<String,String> iterateOverJSON(JSONObject jsonObject){
  Iterator<String> iter=jsonObject.keys();
  HashMap<String,String> keyValueMap=new HashMap<>();
  while (iter.hasNext()) {
    String key=iter.next();
    try {
      String value=jsonObject.getString(key);
      keyValueMap.put(key,value);
    }
 catch (    JSONException e) {
      e.printStackTrace();
    }
  }
  return keyValueMap;
}

public static HashMap < String , String > iterateOverJSON ( JSONObject jsonObject ) { Iterator < String > iter = jsonObject . keys ( ) ; HashMap < String , String > keyValueMap = new HashMap < > ( ) ; while ( iter . hasNext ( ) ) { String key = iter . next ( ) ; try { String value = jsonObject . getString ( key ) ; keyValueMap . put ( key , value ) ; } catch ( JSONException e ) { e . printStackTrace ( ) ; } } return keyValueMap ; }
iterate over all keys of the json
