private static com.google.gson.Gson createGson() {
    GsonBuilder gson = new GsonBuilder();

    // this one is no longer auto-registered
    gson.registerTypeAdapterFactory(new TypeAdapters());

    for (TypeAdapterFactory factory : ServiceLoader.load(TypeAdapterFactory.class)) {
      gson.registerTypeAdapterFactory(factory);
    }

    // register custom serializer for polymorphic Holder
    final HolderJsonSerializer custom = new HolderJsonSerializer();
    gson.registerTypeAdapter(Holder.class, custom);
    gson.registerTypeAdapter(ImmutableHolder.class, custom);
    final GenericTypeJsonSerializer genericTypeJsonSerializer = new GenericTypeJsonSerializer();
    gson.registerTypeAdapter(GenericType.class, genericTypeJsonSerializer);
    gson.registerTypeAdapter(ImmutableGenericType.class, genericTypeJsonSerializer);

    return gson.create();
  }
Drops all collections from a mongo database
mongo/test/org/immutables/mongo/fixture/MongoContext.java