void (final Project project, final Editor editor, @NotNull PsiClass aClass, final boolean toImplement) { ReadAction.nonBlocking(() -> { return prepareChooser(aClass, toImplement); }) .finishOnUiThread(ModalityState.defaultModalityState(), container -> { showAndPerform(project, editor, aClass, toImplement, container); }) .expireWhen(() -> !aClass.isValid()) .submit(AppExecutorUtil.getAppExecutorService()); }