void () { ApplicationConfiguration configuration = new ApplicationConfiguration("Test", getProject()); VmOptionsEditor editor = new VmOptionsEditor(configuration); String text = " -XX:Abc=\"hello world\" -XX<caret>:Def=123"; EditorTextField origField = editor.getTextField(); origField.addNotify(); assertNotNull(origField.getEditor(true)); assertTrue(origField.getEditor().isOneLineMode()); assertFalse(editor.isExpanded()); origField.setText(text.replace("<caret>", "")); origField.getEditor().getCaretModel().moveToOffset(text.indexOf("<caret>")); checkExpectedText(origField, text); editor.expand(); assertTrue(editor.isExpanded()); EditorTextField expanded = editor.getTextField(); expanded.addNotify(); assertNotNull(expanded.getEditor(true)); assertFalse(expanded.getEditor().isOneLineMode()); checkExpectedText(expanded, """ -XX:Abc="hello world" -XX<caret>:Def=123"""); editor.collapse(); expanded.removeNotify(); origField.removeNotify(); }