void () { @Language("JAVA") String text = """ class Foo { int field; int getField() { return field; } }"""; configure(text); UsefulTestCase.assertSize(2, myFixture.getEditor().getFoldingModel().getAllFoldRegions()); myFixture.getEditor().getCaretModel().moveToOffset(myFixture.getEditor().getDocument().getText().indexOf("return")); myFixture.performEditorAction(IdeActions.ACTION_EDITOR_SELECT_WORD_AT_CARET); myFixture.performEditorAction(IdeActions.ACTION_EDITOR_SELECT_WORD_AT_CARET); myFixture.performEditorAction(IdeActions.ACTION_EDITOR_SELECT_WORD_AT_CARET); myFixture.performEditorAction(IdeActions.ACTION_EDITOR_SELECT_WORD_AT_CARET); assertEquals(""" int getField() { return field; }""", myFixture.getEditor().getSelectionModel().getSelectedText()); myFixture.performEditorAction(IdeActions.ACTION_EDITOR_UNSELECT_WORD_AT_CARET); assertEquals(" {\n return field;\n }", myFixture.getEditor().getSelectionModel().getSelectedText()); myFixture.performEditorAction(IdeActions.ACTION_EDITOR_UNSELECT_WORD_AT_CARET); assertEquals("return field;", myFixture.getEditor().getSelectionModel().getSelectedText()); }