Deserializing ImmutableList using Gson
I'm using quite a few immutable collections and I'm curious how to deserialize them using Gson. As nobody answered and I've found the solution myself, I'm simplifying the question and presenting my own answer. I had two problems: How to write a single Deserializer working for all ImmutableList<XXX> ? How to register it for all ImmutableList<XXX> ? Update: There's https://github.com/acebaggins/gson-serializers which covers many guava collections: ImmutableList ImmutableSet ImmutableSortedSet ImmutableMap ImmutableSortedMap How to write a single Deserializer working for all ImmutableList? The