public void testContainsFilter() throws Exception {
FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
// should match only "r2"
GeometryFactory gf = new GeometryFactory();
PackedCoordinateSequenceFactory sf = new PackedCoordinateSequenceFactory();
LinearRing shell = gf.createLinearRing(sf.create(new double[] { 2, -1, 2, 5, 4, 5, 4, -1,
2, -1 }, 2));
Polygon polygon = gf.createPolygon(shell, null);
Contains cs = ff.contains(ff.literal(polygon), ff.property(aname("geom")));
FeatureCollection features = dataStore.getFeatureSource(tname("road")).getFeatures(cs);
checkSingleResult(features, "r2");