FeatureStructure featureStructure = null;
for (FSIterator<FeatureStructure> it = cas.getFSIndexRepository().getAllIndexedFS(
cas.getCasType(type)); it.hasNext();) {
featureStructure = it.next();
if (it.hasNext())
throw new NotSingletonFeatureStructureException();
}
if (featureStructure == null)
throw new FeatureStructureNotFoundException();