box = source.getBounds(new Query("bar", CQL.toFilter("baz = 'ten'")));
assertNotNull(box);
assertTrue(box.contains(new Coordinate(10,10)));
assertFalse(box.contains(new Coordinate(20,20)));
SimpleFeatureReader r = (SimpleFeatureReader)
dataStore.getFeatureReader(new Query("bar"), Transaction.AUTO_COMMIT);
assertNotNull(r);
assertTrue(r.hasNext());
SimpleFeature f = r.next();
assertNotNull(f);
assertTrue(f.getDefaultGeometry() instanceof Point);
assertTrue(new Coordinate(10,10).equals2D(((Point)f.getDefaultGeometry()).getCoordinate()));
assertEquals("ten", f.getAttribute("baz"));
assertTrue(r.hasNext());
f = r.next();
assertNotNull(f);
assertTrue(f.getDefaultGeometry() instanceof Point);
assertTrue(new Coordinate(20,20).equals2D(((Point)f.getDefaultGeometry()).getCoordinate()));
assertEquals("twenty", f.getAttribute("baz"));
r.close();
}