@Test
public void testReadSorted() throws Exception {

    store.autoConfigureStores(Arrays.asList("store1", "store2"));
    Query q = new Query(BASIC_POLYGONS);
    q.setSortBy(new SortBy[] { ff.sort("ID", SortOrder.DESCENDING) });
    List<SimpleFeature> features = listFeatures(q);
    
    assertEquals(4, features.size());
    String prev = null;
    for (SimpleFeature f : features) {
        String id = (String) f.getAttribute("ID");
        if(prev != null) {
            assertTrue(prev.compareTo(id) >= 0);
        }
        prev = id;
    }
}