MongoQueryTranslator extends
        AbstractQueryTranslator<DBObject, DBObject, DBObject> implements
        QueryTranslator<DBObject, DBObject, DBObject> { @Override public DBObject order(String fieldName, Order o) { return object(fieldName, Order.ASCENDING.equals(o) ? 1 : -1); } MongoQueryTranslator(PropertyResolver propertyResolver); @Override DBObject eq(String fieldName, Object value); @Override DBObject ne(String fieldName, Object value); @Override DBObject lt(String fieldName, Object value); @Override DBObject lte(String fieldName, Object value); @Override DBObject gt(String fieldName, Object value); @Override DBObject gte(String fieldName, Object value); @Override DBObject between(String fieldName, Object from, Object to); @Override DBObject in(String fieldName, Object[] values); @Override DBObject notIn(String fieldName, Object[] values); @Override DBObject contains(String fieldName, Object[] values); @Override DBObject isNull(String fieldName); @Override DBObject notNull(String fieldName); @Override DBObject isEmpty(String fieldName); @Override DBObject notEmpty(String fieldName); @Override DBObject within(String fieldName,
            Point<N> center, Number distance); @Override DBObject and(DBObject... subqueries); @Override DBObject or(DBObject... subqueries); @Override DBObject order(String fieldName, Order o); @Override DBObject order(DBObject... orders); @Override DBObject translateProjection(Query<T, R> query);  }
@Test public void ordering_asc() { assertEquals(o(property, 1), translator.order(property, Order.ASCENDING)); }
@Test public void ordering_desc() { assertEquals(o(property, -1), translator.order(property, Order.DESCENDING)); }
@Test public void translateOrdering_many() { DBObject o1 = o("property1", 1); DBObject o2 = o("property2", -1); DBObject o3 = o("property3", 1); DBObject o4 = o("property4", -1); DBObject expected = o(); expected.put("property1", 1); expected.put("property2", -1); expected.put("property3", 1); expected.put("property4", -1); assertEquals(expected, translator.order(o1, o2, o3, o4)); }