@Before
  public void setUp() throws Exception {
    final MongoDatabase database = context.database();
    this.collection = database.getCollection("gsonEntity").withDocumentClass(BsonDocument.class);

    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);
    }

    RepositorySetup setup = RepositorySetup.builder()
        .database(database)
        .gson(gson.create())
        .executor(MoreExecutors.newDirectExecutorService())
        .build();

    this.repository = new GsonEntityRepository(setup);
  }
Tests for repository using <a href="https://github.com/FasterXML/jackson">Jackson</a> library.

@see JacksonCodecs
mongo/test/org/immutables/mongo/fixture/GsonRepoTest.java