code: public static STRtree featureCollectionToSTRtree( SimpleFeatureCollection collection ) {
          STRtree tree = new STRtree();
          SimpleFeatureIterator featureIterator = collection.features();
          while( featureIterator.hasNext() ) {
              SimpleFeature feature = featureIterator.next();
              Geometry geometry = (Geometry) feature.getDefaultGeometry();
              tree.insert(geometry.getEnvelopeInternal(), feature);
          }
          featureIterator.close();
          return tree;
      }
docs: Extracts features from a {@link FeatureCollection} into an {@link STRtree}.
  
  @param collection the feature collection.
  @return the tree containing the features.