Query query = new Query("Person")
.setAncestor(key)
.setKeysOnly();
PreparedQuery preparedQuery = service.prepare(query);
QueryResultIterator<Entity> iter = preparedQuery.asQueryResultIterator();
Assert.assertNotNull(iter.next());
Cursor cursor = iter.getCursor();
iter = service.prepare(query).asQueryResultIterator(FetchOptions.Builder.withStartCursor(cursor));
Assert.assertFalse(iter.hasNext());