private static <T> JsonSerializer<T> serializer(final Codec<T> codec) {
    Objects.requireNonNull(codec, "codec");
    return new CodecSerializer<>(codec);
  }
Create {@link CodecRegistry} adapter on the top of existing mapper instance
criteria/mongo/src/org/immutables/criteria/mongo/bson4jackson/JacksonCodecs.java