You need to use a TypeToken
to correctly express the type. Class
is not sufficient in this case, because of the interaction with the generic type.
Type listType = new TypeToken>(){}.getType();
List projects = (List) gson.fromJson(response, listType);