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

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