boolean (final PsiMethod method) { final List<PsiReference> nonTailCallUsages = Collections.synchronizedList(new ArrayList<>()); boolean result = ProgressManager.getInstance().runProcessWithProgressSynchronously( (Runnable)() -> ReferencesSearch.search(method).forEach(psiReference -> { ProgressManager.checkCanceled(); if (getTailCallType(psiReference) == TailCallType.None) { nonTailCallUsages.add(psiReference); return false; } return true; }), JavaRefactoringBundle.message("inline.method.checking.tail.calls.progress"), true, method.getProject()); return result && nonTailCallUsages.isEmpty(); }