@Test 
public void testSetOnSelection() throws Exception {

    SimpleFeatureStore transformed = (SimpleFeatureStore) transformWithSelection();
    SimpleFeatureBuilder fb = new SimpleFeatureBuilder(transformed.getSchema());
    fb.add(wkt.read("POINT (-120 40)").buffer(3));
    fb.add("baloon");
    fb.add(1);
    SimpleFeature sf = fb.buildFeature("states_mini.11");
    
    // set the feature
    transformed.setFeatures(new CollectionFeatureReader(new SimpleFeature[] {sf}));
    
    // check it's there and it's the only one
    int size = STATES.getCount(Query.ALL);
    assertEquals(1, size);
    
    assertEquals(1, STATES.getFeatures(new Query(null, CQL.toFilter("state_name = 'baloon'"))).size());
    assertEquals(1, transformed.getFeatures(new Query(null, CQL.toFilter("state_name = 'baloon'"))).size());
}