void () { configureFromFileText("a.java", """ class Foo { void bar() { <selection>System.out.println()</selection>; } }"""); SelectionModel model = getEditor().getSelectionModel(); PsiExpression expr = IntroduceVariableUtil.getSelectedExpression(getFile().getProject(), getFile(), model.getSelectionStart(), model.getSelectionEnd()); assertNotNull(expr); assertFalse(new JavaWithParenthesesSurrounder().isApplicable(expr)); assertFalse(new JavaWithCastSurrounder().isApplicable(expr)); }