DAOUtils { static BsonDocument validContent(final BsonDocument newContent) { return (newContent == null) ? new BsonDocument() : newContent; } private  DAOUtils(); static OperationResult updateMetadata(
            final ClientSession cs,
            final MongoCollection<BsonDocument> coll,
            final Object documentId,
            final BsonDocument filter,
            final BsonDocument shardKeys,
            final BsonDocument data,
            final boolean patching); static OperationResult updateDocument(
            final ClientSession cs,
            final MongoCollection<BsonDocument> coll,
            final Object documentId,
            final BsonDocument filter,
            final BsonDocument shardKeys,
            final BsonDocument data,
            final boolean replace); @SuppressWarnings("rawtypes") static OperationResult updateDocument(
            final ClientSession cs,
            final MongoCollection<BsonDocument> coll,
            final Object documentId,
            final BsonDocument filter,
            final BsonDocument shardKeys,
            final BsonDocument data,
            final boolean replace,
            final boolean deepPatching,
            final boolean allowUpsert); static boolean restoreDocument(
            final ClientSession cs,
            final MongoCollection<BsonDocument> coll,
            final Object documentId,
            final BsonDocument shardKeys,
            final BsonDocument data,
            final Object etag,
            final String etagLocation); static BulkOperationResult bulkUpsertDocuments(
            final ClientSession cs,
            final MongoCollection<BsonDocument> coll,
            final BsonArray documents,
            final BsonDocument filter,
            final BsonDocument shardKeys); final static Logger LOGGER; static final int DUPLICATE_KEY_ERROR; static final int BAD_VALUE_KEY_ERROR; final static FindOneAndUpdateOptions FAU_UPSERT_OPS; final static FindOneAndUpdateOptions FAU_NOT_UPSERT_OPS; final static FindOneAndUpdateOptions FOU_AFTER_UPSERT_OPS; final static FindOneAndReplaceOptions FOR_AFTER_UPSERT_OPS; final static FindOneAndUpdateOptions FOU_AFTER_NOT_UPSERT_OPS; final static FindOneAndReplaceOptions FOR_AFTER_NOT_UPSERT_OPS; final static UpdateOptions U_UPSERT_OPS; final static UpdateOptions U_NOT_UPSERT_OPS; final static ReplaceOptions R_NOT_UPSERT_OPS; final static BulkWriteOptions BWO_NOT_ORDERED; }
@Test public void testValidContent() { BsonDocument dbo = DAOUtils.validContent(null); assertNotNull(dbo); assertTrue(dbo.isDocument()); dbo = new BsonDocument("name", new BsonString("test")); assertEquals(DAOUtils.validContent(dbo), dbo); }