boolean (@NotNull PsiElement element) { if (!(element instanceof final GrMethodCallExpression call)) { return false; } final GrExpression invokedExpression = call.getInvokedExpression(); if (!(invokedExpression instanceof final GrReferenceExpression referenceExpression)) { return false; } final String name = referenceExpression.getReferenceName(); if (!"call".equals(name)) { return false; } final GrExpression qualifier = referenceExpression.getQualifierExpression(); if (qualifier == null) { return false; } final PsiType qualifierType = qualifier.getType(); if (qualifierType == null) { return false; } if (!qualifierType.equalsToText(GroovyCommonClassNames.GROOVY_LANG_CLOSURE)) { return false; } return !ErrorUtil.containsError(element); }