final IndexedEntity b = new IndexedEntity("b");
final IndexedEntity c = new IndexedEntity("c");
Datastore ds = getDs();
ds.save(a);
ds.save(b);
ds.save(c);
Assert.assertEquals("last", b.id, ds.createQuery(IndexedEntity.class).order("-id")
.upperIndexBound(new BasicDBObject("testField", "c")).get().id);