boolean (Project project, Editor editor, PsiFile file) { CreateTestAction action = new CreateTestAction(); PsiElement element = file.findElementAt(editor.getCaretModel().getOffset()); if (element != null) { return action.isAvailable(project, editor, element); } return false; }