public static <DeclarationType extends ceylon.language.meta.declaration.Declaration>
DeclarationType findDeclarationByName(Sequential<? extends DeclarationType> declarations, String name) {
Iterator<? extends DeclarationType> iterator = declarations.iterator();
Object it;
while((it = iterator.next()) != finished_.get_()){
@SuppressWarnings("unchecked")
DeclarationType tp = (DeclarationType) it;
if(tp.getName().equals(name))
return tp;
}
return null;
}