code: public JSONObject element( String key, Map value, JsonConfig jsonConfig ) {
        verifyIsNull();
        if( value instanceof JSONObject ){
           return setInternal( key, value, jsonConfig );
        }else{
           return element( key, JSONObject.fromObject( value, jsonConfig ), jsonConfig );
        }
     }
docs: Put a key/value pair in the JSONObject, where the value will be a
  JSONObject which is produced from a Map.
  
  @param key A key string.
  @param value A Map value.
  @return this.
  @throws JSONException