void (@NotNull PsiMethod psiMethod, @NotNull Editor editor) { PsiExpression expression = PsiTreeUtil.findChildOfType(psiMethod, PsiExpression.class); assertNotNull(expression); int offset = expression.getTextRange().getEndOffset(); editor.getCaretModel().moveToOffset(offset); String hint = "Replace Optional chain with if statements"; List<IntentionAction> actions = myFixture.filterAvailableIntentions(hint); assertSize(1, actions); myFixture.launchAction(actions.get(0)); }