code: public static List<Geometry> featureCollectionToGeometriesList( SimpleFeatureCollection collection, boolean doSubGeoms,
              String userDataField ) {
          List<Geometry> geometriesList = new ArrayList<Geometry>();
          if (collection == null) {
              return geometriesList;
          }
          SimpleFeatureIterator featureIterator = collection.features();
          while( featureIterator.hasNext() ) {
              SimpleFeature feature = featureIterator.next();
              Geometry geometry = (Geometry) feature.getDefaultGeometry();
              if (geometry != null)
                  if (doSubGeoms) {
                      int numGeometries = geometry.getNumGeometries();
                      for( int i = 0; i < numGeometries; i++ ) {
                          Geometry geometryN = geometry.getGeometryN(i);
                          geometriesList.add(geometryN);
                          if (userDataField != null) {
                              Object attribute = feature.getAttribute(userDataField);
                              geometryN.setUserData(attribute);
                          }
                      }
                  } else {
                      geometriesList.add(geometry);
                      if (userDataField != null) {
                          Object attribute = feature.getAttribute(userDataField);
                          geometry.setUserData(attribute);
                      }
                  }
          }
          featureIterator.close();
          return geometriesList;
      }
docs: Extracts features from a {@link FeatureCollection} into an {@link ArrayList} of its geometries.
  
  @param collection the feature collection.
  @param doSubGeoms split the geometries in single geometries (ex. MultiLines in Lines).
  @param userDataField if not <code>null</code>, the data in the field are put in the userData
  field of the geometry.
  @return the list with the geometries or an empty list if no features present.