I think you can! From the Gson user guide:
You can solve this problem by specifying the correct parameterized type for your generic type. You can do this by using the TypeToken class.
This means that you could in theory, wrap your Map like so:
Type t = new TypeToken<Map<String,Machine>>() {}.getType();
Map<String,Machine> map = (Map<String,Machine>) new Gson().fromJson("json", t);
Or (in my case) I had to wrap a List like so:
Type t = new TypeToken<List<SearchResult>>() {}.getType();
List<SearchResult> list = (List<SearchResult>) new Gson().fromJson("json", t);
for (SearchResult r : list) {
System.out.println(r);
}
(I was getting the exception "java.lang.ClassCastException: com.google.gson.internal.StringMap cannot be cast to my.SearchResult".)