I have this code:
Type typeOfObjectsList = new TypeToken>() {}.getType();
List objectsList = new Gson().fromJso
sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl
workes. No need for custom implementation
Type type = ParameterizedTypeImpl.make(List.class, new Type[]{childrenClazz}, null);
List list = gson.fromJson(json, type);
Can be used with maps and any other collection:
ParameterizedTypeImpl.make(Map.class, new Type[]{String.class, childrenClazz}, null);
Here is nice demo how you can use it in custom deserializer: Deserializing ImmutableList using Gson