if (collection != null) {
if (!(collection.getSchema() instanceof SimpleFeatureType)) {
// put wrapper around it with layer name
Name name = new NameImpl(layer.getFeature().getNamespace().getName(), layer
.getFeature().getName());
collection = new FeatureCollectionDecorator(name, collection);
}
int size = collection.size();
if (size != 0) {