List<SimpleMatch> (@NotNull SimpleDuplicatesFinder finder, @NotNull List<? extends PsiElement> searchScopes, @NotNull PsiElement generatedMethod) { final Project project = generatedMethod.getProject(); try { //noinspection RedundantCast return ProgressManager.getInstance().runProcessWithProgressSynchronously( (ThrowableComputable<List<SimpleMatch>, RuntimeException>)() -> { ProgressManager.getInstance().getProgressIndicator().setIndeterminate(true); return ReadAction.compute(() -> finder.findDuplicates(searchScopes, generatedMethod)); }, RefactoringBundle.message("searching.for.duplicates"), true, project); } catch (ProcessCanceledException e) { return Collections.emptyList(); } }