MongoQueryExecutor implements QueryExecutor { @VisibleForTesting protected WriteResult save(DBCollection collection, DBObject entity) { return collection.save(entity, this.writeConcern); } 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 save() { final TestClass saved = executor.save(t1); assertEquals(t1, saved); }
@Test public void save_many() { final Iterable<TestClass> saved = executor.save(Arrays.asList(tests)); final Iterator<TestClass> iterator = saved.iterator(); for (int i = 0; i < tests.length; i++) { assertEquals(tests[i], iterator.next()); } }