SimpleFeature feature = null;
// classiferExample start
FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
Function classify = ff.function("Quantile", ff.property("name"), ff.literal(2));
Classifier groups = (Classifier) classify.evaluate(collection);
// classiferExample end
// classiferExample2 start
groups.setTitle(0, "Group A");
groups.setTitle(1, "Group B");
// classiferExample2 end
// classiferExample3 start
// groups is a classifier with "Group A" and "Group B"
Function sort = ff.function("classify", ff.property("name"), ff.literal(groups));
int slot = (Integer) sort.evaluate(feature);
System.out.println(groups.getTitle(slot)); // ie. "Group A"
// classiferExample3 end
}