private static CodecRegistry defaultRegistry(UuidRepresentation uuidRepresentation) {
    CodecRegistry standard = CodecRegistries.fromProviders(
            new BsonValueCodecProvider(),
            new Jsr310CodecProvider());

    // avoid codecs for String / Long / Boolean etc. They're already handled by jackson
    // choose the ones which need to be natively serialized in non-JSON format (BSON)
    CodecRegistry others = CodecRegistries.fromCodecs(new ObjectIdCodec(),
            new DateCodec(), new UuidCodec(uuidRepresentation),
            new Decimal128Codec(),
            new PatternCodec(),
            new BigDecimalCodec(), new ByteArrayCodec());

    return CodecRegistries.fromRegistries(standard, others);
  }
Registers default BSON codecs like {@link BsonValueCodecProvider} or
{@link Jsr310CodecProvider} so BSON types can be serialized / deserialized by Jackson in
native format.
criteria/mongo/src/org/immutables/criteria/mongo/bson4jackson/BsonModule.java