private static void clearDatabase(MongoDatabase database) {
    for (String name: database.listCollectionNames()) {
      database.getCollection(name).drop();
    }
  }
Drops all collections from a mongo database
mongo/test/org/immutables/mongo/fixture/MongoContext.java