code: public static Map<String, Object> jsonObjectToMap(JSONObject jsonObj)
      {
          Map<String, Object> map = new Hashtable<String, Object>();
          
          Iterator<?> iterator = jsonObj.keys();
          while (iterator.hasNext())
          {
              try {
                  String key = (String)iterator.next();
                  String value = jsonObj.getString(key);  // TODO what if this is a JSONObject?
                  map.put(key, value);
              } catch (JSONException e) {
                  e.printStackTrace();
              }
          }
          return map;
      }
docs: Utility to convert a map to a JSON object.
  @param mapDBParentProperties
  @return