boolean (GrAnnotation annotation) { final PsiElement parent = annotation.getParent(); if (parent instanceof GrModifierList) { final GrAnnotation collector = ContainerUtil.find(((GrModifierList)parent).getRawAnnotations(), annotation1 -> GroovyCommonClassNames.GROOVY_TRANSFORM_ANNOTATION_COLLECTOR.equals( annotation1.getQualifiedName())); if (collector != null) { return true; } } return false; }