MongoQueryExecutor implements QueryExecutor { public <T, R> void remove(Query<T, R> query) { try { getCollection(query.getEntityClass()).remove( this.queryTranslator.translate(query), 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 remove() { final DBCursor cursor = new MockDBCursor(this.collection, toDBObject(this.t1)); this.executor.cursor = cursor; TestClass found = this.executor.findOne(this.query); assertEquals(this.t1, found); this.executor.remove( QueryBuilder.builderFor(this.entityClass). add(Restrictions.eq(ID_PROPERTY_NAME, 1)). build()); found = this.executor.findOne(this.query); assertNull(found); }