void (Project project, Editor editor, PsiFile file) { try { CreateTestAction action = new CreateTestAction(); PsiElement element = findElement(file, editor.getCaretModel().getOffset()); if (CreateTestAction.isAvailableForElement(element)) { action.invoke(project, editor, element); } } catch (IncorrectOperationException e) { LOG.warn(e); } }