* custom serializer, so try again after wrapping as an object property.
* We do this trick only as a fallback since it causes Jackson to consider the parameter
* as "Object" and thus ignore any annotations that may exist on its actual class.
*/
private Object marshallPrimitiveWithWrapper(Object parameter) {
final BsonDocument document;
Map<String, Object> primitiveWrapper = Collections.singletonMap("wrapped", parameter);
document = marshaller.marshall(primitiveWrapper);
return document.toDBObject().get("wrapped");
}