}
String name = type.getName();
RutaBasic firstBasicOfAll = stream.getFirstBasicOfAll();
if ("uima.tcas.DocumentAnnotation".equals(name)
|| "org.apache.uima.ruta.type.Document".equals(name)
|| (stream.getDocumentAnnotationType().getName().equals(name) && (firstBasicOfAll != null && firstBasicOfAll
.beginsWith(type)))) {
// TODO what about dynamic windowing?
annotations.add(stream.getDocumentAnnotation());
} else {
annotations.addAll(stream.getAnnotations(type));