store2.addFeatureListener(listener2);
FilterFactory factory = CommonFactoryFinder.getFilterFactory(null);
// test that only the listener listening with the current transaction gets the event.
final SimpleFeature feature = roadFeatures[0];
store1.removeFeatures(factory.id(Collections.singleton(factory.featureId(feature.getID()))));
assertEquals(1, listener1.events.size());
assertEquals(0, listener2.events.size());
FeatureEvent event = listener1.getEvent(0);
assertEquals(feature.getBounds(), event.getBounds());
assertEquals(FeatureEvent.FEATURES_REMOVED, event.getEventType());