### Question:
JamonProvider extends SortableDataProvider<Monitor, String> { public Iterator<Monitor> iterator(long first, long count) { List<Monitor> allMonitors = jamonRepository.find(specification); long toIndex = allMonitors.size() < (first + count) ? allMonitors.size() : (first + count); if (first > toIndex) { return EMPTY_ITERATOR; } else { List<Monitor> monitors = allMonitors.subList((int)first, (int)toIndex); final String sortProperty = this.getSort().getProperty(); final boolean ascending = this.getSort().isAscending(); Collections.sort(monitors, new PropertyModelObjectComparator(ascending, sortProperty)); return monitors.iterator(); } } JamonProvider(MonitorSpecification specification); Iterator<Monitor> iterator(long first, long count); IModel<Monitor> model(Monitor object); long size();  }### Answer:
@Test void shouldSupportSortingOfProperties() { startThisManyMonitors(3); jamonProvider.setSort("label", SortOrder.ASCENDING); Iterator<Monitor> ascendingIterator = jamonProvider.iterator(0, 3); assertEquals("mon0", ascendingIterator.next().getLabel()); assertEquals("mon1", ascendingIterator.next().getLabel()); assertEquals("mon2", ascendingIterator.next().getLabel()); jamonProvider.setSort("label", SortOrder.DESCENDING); Iterator<Monitor> descendingIterator = jamonProvider.iterator(0, 3); assertEquals("mon2", descendingIterator.next().getLabel()); assertEquals("mon1", descendingIterator.next().getLabel()); assertEquals("mon0", descendingIterator.next().getLabel()); }