Query query = new Query();
query.setFilter(filter);
// check we're respecting the geometry factory hint
GeometryFactory gf1 = new GeometryFactory();
query.setHints(new Hints(Hints.JTS_GEOMETRY_FACTORY, gf1));
SimpleFeature f1 = getFirstFeature(featureSource.getFeatures(query));
assertSame(gf1, ((Geometry) f1.getDefaultGeometry()).getFactory());
// check we're respecting the geometry factory when changing it
GeometryFactory gf2 = new GeometryFactory();
query.setHints(new Hints(Hints.JTS_GEOMETRY_FACTORY, gf2));
SimpleFeature f2 = getFirstFeature(featureSource.getFeatures(query));
assertSame(gf2, ((Geometry) f2.getDefaultGeometry()).getFactory());
}