}
@Test
public void distinctWithQuery() throws Exception {
/* given */
collection.save(new Friend("John", new Coordinate(1, 2)));
collection.save(new Friend("Peter", new Coordinate(1, 2)));
String emptyName = null;
collection.save(new Friend(emptyName, new Coordinate(125, 72)));
/* when */
Iterator<Coordinate> coordinates = collection.distinct("coordinate").query("{name:{$exists:true}}").as(Coordinate.class).iterator();
/* then */