I am looking for a nice way to pretty-print a Map.
Map
map.toString() gives me: {key1=value1, key2=value2, key3=value3}
map.toString()
{key1=value1, key2=value2, key3=value3}
I
When I have org.json.JSONObject in the classpath, I do:
org.json.JSONObject
Map stats = ...; System.out.println(new JSONObject(stats).toString(2));
(this beautifully indents lists, sets and maps which may be nested)