private static boolean checkCalls(PsiElement scope, PsiMethod method) {
    if (scope instanceof GrMethodCall) {
      PsiMethod refMethod = ((GrMethodCall)scope).resolveMethod();
      if (method.equals(refMethod)) return true;
    }

    for (PsiElement child = scope.getFirstChild(); child != null; child = child.getNextSibling()) {
      if (checkCalls(child, method)) return true;
    }

    return false;
  }
private static boolean checkCalls(PsiElement scope, PsiMethod method)