JsonLib implements Jsonable { private String arrayToJson(Object bean){ JSONArray jsonArray = JSONArray.fromObject(bean, jsonConfig); return jsonArray.toString(); }  String toJSONString(Object bean); @SuppressWarnings("unchecked") @Override T toBean(String json, Class<T> beanClass); @SuppressWarnings("unchecked") @Override List<T> toList(String json, Class<T> beanClass); @Override void setDatePattern(String datePattern); @Override void setExcludes(String[] excludes); @Override com.alibaba.fastjson.JSONObject toJSON(Object bean); @Override com.alibaba.fastjson.JSONArray toJSONArray(Object bean);  }
@Test public void arrayToJson() { String objectToJson = jsonlib.toJSONString(array); System.out.println(objectToJson); }