boolean isRealMongo() {
    Bson buildInfo = BsonDocument.parse("{buildInfo:1}");
    return Single.fromPublisher(database().runCommand(buildInfo))
            .map(bson -> bson.containsKey("gitVersion") && bson.containsKey("version"))
            .onErrorReturn(x -> false)
            .blockingGet();
  }
Detect if current mongo instance is fake (as in <a href="https://github.com/bwaldvogel/mongo-java-server">Mongo Java Server</a>)
or real (stand-alone database or docker container).
criteria/mongo/test/org/immutables/criteria/mongo/MongoInstance.java