private boolean shouldDelegate(GrReferenceExpression referenceExpression, @Nullable PsiElement resolved) {
        if (referenceExpression.isQualified()) {
          return false;
        }

        if (resolved instanceof GrField) {
          return true;
        }

        if (resolved instanceof PsiMethod) {
          String methodName = ((PsiMethod)resolved).getName();
          return functionalExpression != null &&
                 ("getDelegate".equals(methodName) || "getOwner".equals(methodName)) || "call".equals(methodName);
        }

        return false;
      }
private boolean shouldDelegate(GrReferenceExpression referenceExpression, @Nullable PsiElement resolved)