SortablePersonDataProvider provider = new SortablePersonDataProvider();
int pageSize = NUMBER_OF_TEST_PEOPLE - 1;
// test the default sort is by label
Iterator<IFoafResource> iterator = provider.iterator(0, pageSize);
IFoafResource person;
String prev = null;
String current;
int count = 0;
while (iterator.hasNext()) {
person = iterator.next();
current = (String) person.getLabel();
if (prev != null) {
assertTrue("Incorrect sort order: " + prev + " preceeds " + current,
current.compareTo(prev) >= 0);
}
prev = current;