How to convert or cast hashmap to JSON object in Java, and again convert JSON object to JSON string?
For those using org.json.simple.JSONObject, you could convert the map to Json String and parse it to get the JSONObject.
org.json.simple.JSONObject
JSONObject
JSONObject object = (JSONObject) new JSONParser().parse(JSONObject.toJSONString(map));