// create filtered iterator over Tokens of type 1
FSIterator<AnnotationFS> it = cas.getAnnotationIndex(tokenType).iterator();
FSStringConstraint type1Constraint = cas.getConstraintFactory().createStringConstraint();
type1Constraint.equals(lemma);
FeaturePath path = cas.createFeaturePath();
path.addFeature(lemmaFeat);
FSMatchConstraint cons = cas.getConstraintFactory().embedConstraint(path, type1Constraint);
it = cas.createFilteredIterator(it, cons);
int count = 0;
for (it.moveToFirst(); it.isValid(); it.moveToNext()) {