PsiAnnotation[] (PsiElement element) { return SyntaxTraverser.psiTraverser(element).filter(PsiAnnotation.class) .filter(anno -> { String name = anno.getQualifiedName(); return name != null && name.startsWith("org.testng.annotations"); }).toArray(PsiAnnotation.EMPTY_ARRAY); }