This link from the Gson project seems to indicate that I would have to do something like the following for serializing a typed Map to JSON:
public static
Only the TypeToken part is neccesary (when there are Generics involved).
Map myMap = new HashMap();
myMap.put("one", "hello");
myMap.put("two", "world");
Gson gson = new GsonBuilder().create();
String json = gson.toJson(myMap);
System.out.println(json);
Type typeOfHashMap = new TypeToken
Output:
{"two":"world","one":"hello"}
hello
world