private static <T> Codec<T> findCodecOrNull(CodecRegistry registry, Class<T> type) {
    try {
      return registry.get(type);
    } catch (CodecConfigurationException e) {
      return null;
    }
  }
Create {@link CodecRegistry} adapter on the top of existing mapper instance
criteria/mongo/src/org/immutables/criteria/mongo/bson4jackson/JacksonCodecs.java