Map to JSON (string)

import org.json.JSONObject;

JSONObject json = new JSONObject();

try {

    for (Map.Entry<String, String> entry : stringStringMap.entrySet()) {

        json.put(entry.getKey(), entry.getValue());

    }

} catch (JSONException e) {

    throw
new HttpMessageNotWritableException(“A map to json conversion failed” + e.getMessage(), e);

}

json.toString()….