MongoQueryExecutor implements QueryExecutor { public void removeAll(Class<?> entityClass) { try { getCollection(entityClass).remove( new BasicDBObject(), this.writeConcern); } catch (final MongoException mx) { throw new DataStoreException(mx.getMessage(), mx); } } MongoQueryExecutor(
            DB db,
            WriteConcern writeConcern,
            MongoQueryTranslator queryTranslator,
            EntityResolver entityResolver,
            final int batchSize);  MongoQueryExecutor(
            DB db,
            WriteConcern writeConcern,
            MongoQueryTranslator queryTranslator,
            EntityResolver entityResolver);  MongoQueryExecutor(
            Mongo mongo,
            String database,
            WriteConcern writeConcern,
            MongoQueryTranslator queryTranslator,
            EntityResolver entityResolver);  MongoQueryExecutor(
            Mongo mongo,
            String database,
            WriteConcern writeConcern,
            MongoQueryTranslator queryTranslator,
            EntityResolver entityResolver,
            final int batchSize); DB getDB(); DBCollection getCollection(Class<?> entityClass); void remove(Query<T, R> query); void removeAll(Class<?> entityClass); @Override Iterable<R> find(Query<T, R> query); @Override R findOne(Query<T, R> query); @Override T save(T entity); @Override Iterable<T> save(Iterable<T> entities);  }
@Test public void removeAll() { final DBCursor cursor = new MockDBCursor(this.collection, toDBObjectArray(this.tests)); this.executor.cursor = cursor; Iterable<TestClass> found = this.executor.find(this.query); for (int i = 0; i < this.tests.length; i++) { assertEquals(this.tests[i], found.iterator().next()); } this.executor.removeAll(TestClass.class); found = this.executor.find(this.query); assertFalse(found.iterator().hasNext()); }