private static void validate(Repositories.Criteria criteria, BsonDocument expected) {
    BsonDocument actual = MongoAsserts.extractQuery(criteria);
    check(actual).is(expected);
  }
Converts given {@code criteria} to bson and compares with {@code expected}.

@param criteria existing criteria to be sent to mogno (usually mongo query)
@param expected expected query (as bson)
mongo/test/org/immutables/mongo/fixture/criteria/QueryTest.java