code: public static <T, K> JacksonDBCollection<T, K> wrap(DBCollection dbCollection, Class<T> type, Class<K> keyType, Class<?> view) {
          ObjectMapper objectMapper = new ObjectMapper();
          objectMapper.setSerializationConfig(objectMapper.getSerializationConfig().withView(view));
          MongoJacksonMapperModule.configure(objectMapper);
          return new JacksonDBCollection<T, K>(dbCollection, DEFAULT_OBJECT_MAPPER.constructType(type),
                  DEFAULT_OBJECT_MAPPER.constructType(keyType), objectMapper, null);
      }
docs: Wraps a DB collection in a JacksonDBCollection
  
  @param dbCollection The DB collection to wrap
  @param type         The type of objects to deserialise to
  @param keyType      The type of the objects key
  @param view         The JSON view to use for serialisation
  @return The wrapped collection