PsiAnnotation (@Nullable PsiClass clazz) { if (clazz != null) { final PsiModifierList modifierList = clazz.getModifierList(); if (modifierList != null) { PsiAnnotation[] annotations = modifierList instanceof GrModifierList ? ((GrModifierList)modifierList).getRawAnnotations() : modifierList.getAnnotations(); for (PsiAnnotation annotation : annotations) { if (GROOVY_TRANSFORM_ANNOTATION_COLLECTOR.equals(annotation.getQualifiedName())) { return annotation; } } } } return null; }