When calling the toList() method of a JSONArray which contains JSONObject the returned list contains HashMap elements. The documentation mentions: Returns a java.util.List containing all of the ...
JSONObject<String> object = new JSONObject<String>(); To remove the need of castings when getting an object or an array, add, in the JSONObject class, two methods getAsObject () and getAsArray () ...