ftb.add(LABEL_COLUMN, String.class);
ftb.setName(MY_FEATURE);
final SimpleFeatureType schema = ftb.buildFeatureType();
// create a feature collection ----------------------------------------
final MemoryFeatureCollection fc = new MemoryFeatureCollection(schema);
// populate the collection --------------------------------------------
final PrecisionModel pm = new PrecisionModel(PrecisionModel.FLOATING);
final GeometryFactory jtsFactory = new GeometryFactory(pm, SRID);
// create 1st point
final Point g1 = jtsFactory.createPoint(new Coordinate(X_1, Y_1));
fc.add(SimpleFeatureBuilder.build(schema, new Object[] { new Integer(1), g1, LABEL_1 }, ID_1));
// create 2nd point
final Point g2 = jtsFactory.createPoint(new Coordinate(X_2, Y_2));
fc.add(SimpleFeatureBuilder.build(schema, new Object[] { new Integer(2), g2, LABEL_2 }, ID_2));
final DataStore ds = new MemoryDataStore(fc);
// create and populate the layer --------------------------------------
final StyleFactory sf = CommonFactoryFinder.getStyleFactory(GeoTools.getDefaultHints());