FSIntConstraint intConstraint = cf.createIntConstraint();
intConstraint.geq(windowAnnotation.getBegin());
FSMatchConstraint beginConstraint = cf.embedConstraint(beginFP, intConstraint);
FeaturePath endFP = cas.createFeaturePath();
endFP.addFeature(type.getFeatureByBaseName("end"));
intConstraint = cf.createIntConstraint();
intConstraint.leq(windowAnnotation.getEnd());
FSMatchConstraint endConstraint = cf.embedConstraint(endFP, intConstraint);
FSMatchConstraint windowConstraint = cf.and(beginConstraint, endConstraint);