@Test
public void testOffset() throws FileNotFoundException, IOException {

    Query query = new Query(Query.ALL);
    query.setStartIndex(3);
    SimpleFeatureSource rows = csvDataStore.getFeatureSource();
    SimpleFeatureCollection matches = rows.getFeatures(query);
    List<String> offsetCities = Arrays.asList("Ottawa", "Minneapolis", "Lausanne", "Victoria", "Cape Town", "Sydney");
    int count = 0;
    SimpleFeatureIterator iter = matches.features();
    while(iter.hasNext()) {
        SimpleFeature f = iter.next();
        assertTrue(offsetCities.contains(f.getAttribute("CITY")));
        count++;
    }
    iter.close();
    assertEquals(6, count);
    assertEquals(6, matches.size());
    assertEquals(6, rows.getCount(query));
}