FeaturePath endPath = getCAS().createFeaturePath();
endPath.addFeature(annotationType.getFeatureByBaseName("end"));
FSIntConstraint endConstraint = cf.createIntConstraint();
endConstraint.leq(span.getEnd());
FSMatchConstraint embeddedEnd = cf.embedConstraint(endPath, endConstraint);
FSMatchConstraint strictType = new StrictTypeConstraint(type);
FSMatchConstraint annotatioInSpanConstraint = cf.and(embeddedBegin, embeddedEnd);