code: public static Object toJava( JSON json, JsonConfig jsonConfig ) {
        if( JSONUtils.isNull( json ) ){
           return null;
        }
  
        Object object = null;
  
        if( json instanceof JSONArray ){
           if( jsonConfig.getArrayMode() == JsonConfig.MODE_OBJECT_ARRAY ){
              object = JSONArray.toArray( (JSONArray) json, jsonConfig );
           }else{
              object = JSONArray.toCollection( (JSONArray) json, jsonConfig );
           }
        }else{
           object = JSONObject.toBean( (JSONObject) json, jsonConfig );
        }
  
        return object;
     }
docs: Transform a JSON value to a java object.<br>
  Depending on the configured values for conversion this will return a
  DynaBean, a bean, a List, or and array.
  
  @param json a JSON value
  @param jsonConfig additional configuration
  @return depends on the nature of the source object (JSONObject, JSONArray,
  JSONNull) and the configured rootClass, classMap and arrayMode