void () { String name = getTestName(false); configureByFile("/codeInsight/generateSuperMethodCall/before" + name + ".java"); String after = "/codeInsight/generateSuperMethodCall/after" + name + ".java"; boolean mustBeAvailable = new File(getTestDataPath() + after).exists(); boolean isValid = new GenerateSuperMethodCallAction() { @Override protected boolean isValidForFile(@NotNull Project project, @NotNull Editor editor, @NotNull final PsiFile file) { return super.isValidForFile(project, editor, file); } }.isValidForFile(getProject(), getEditor(), getFile()); assertEquals(mustBeAvailable, isValid); if (mustBeAvailable) { CodeInsightActionHandler handler = new GenerateSuperMethodCallAction() { @NotNull @Override protected CodeInsightActionHandler getHandler() { return super.getHandler(); } }.getHandler(); ApplicationManager.getApplication().runWriteAction(() -> handler.invoke(getProject(), getEditor(), getFile())); checkResultByFile(after); } }