boolean (@NotNull PsiElement element) { if (element.getLanguage() != GroovyLanguage.INSTANCE) return false; GrMethod method; final PsiReference ref = element.getReference(); if (ref != null) { final PsiElement resolved = ref.resolve(); if (!(resolved instanceof GrMethod)) return false; method = (GrMethod)resolved; } else { final PsiElement parent = element.getParent(); if (!(parent instanceof GrMethod)) return false; if (((GrMethod)parent).getNameIdentifierGroovy() != element) return false; method = (GrMethod)parent; } return !method.isConstructor() && isJavaIdentifier(method.getName()) && method.hasBlock() && method.getParent() instanceof GrTypeDefinitionBody; }