code: public SimpleFeatureCollection toFeatureCollection(
              List<MonitoringPoint> monitoringPointsList ) {
  
          // create the feature type
          SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder();
          // set the name
          b.setName("monitoringpoints");
          // add a geometry property
          b.add("the_geom", Point.class);
          // add some properties
          b.add("id", Integer.class);
          b.add("relatedid", Integer.class);
          b.add("pfaf", String.class);
          // build the type
          SimpleFeatureType type = b.buildFeatureType();
          // create the feature
          SimpleFeatureBuilder builder = new SimpleFeatureBuilder(type);
  
          GeometryFactory gF = new GeometryFactory();
          /*
           * insert them in inverse order to get them out of the collection in the same order as the
           * list
           */
          DefaultFeatureCollection newCollection = new DefaultFeatureCollection();
          for( int i = 0; i < monitoringPointsList.size(); i++ ) {
              MonitoringPoint mp = monitoringPointsList.get(monitoringPointsList.size() - i - 1);
  
              Object[] values = new Object[]{gF.createPoint(mp.getPosition()), mp.getID(),
                      mp.getRelatedID(), mp.getPfatstetterNumber().toString()};
              // add the values
              builder.addAll(values);
              // build the feature with provided ID
              SimpleFeature feature = builder.buildFeature(type.getTypeName() + "." + i);
              newCollection.add(feature);
          }
  
          return newCollection;
      }
docs: Create a featurecollection from a list of monitoringpoints. Based on the position of the
  points and some of their attributes.
  
  @param monitoringPointsList
  @return the featurecollection