@Test
  public void objectId() throws IOException {
    ObjectId id = ObjectId.get();
    check(Jsons.readerAt(new BsonObjectId(id)).peek()).is(JsonToken.STRING);
    check(Jsons.readerAt(new BsonObjectId(id)).nextString()).is(id.toHexString());
  }
Validate type conversion between BSON and gson-JSON ({@link com.google.gson.stream.JsonToken}).
mongo/test/org/immutables/mongo/bson4gson/TypeConversionTest.java