void (Project project, Editor editor, PsiFile file) { try { CreateTestAction action = new CreateTestAction(); PsiElement element = file.findElementAt(editor.getCaretModel().getOffset()); if (element != null && action.isAvailable(project, editor, element)) { action.invoke(project, editor, file.getContainingFile()); } } catch (IncorrectOperationException e) { LOG.warn(e); } }