void () { configureByText(JavaFileType.INSTANCE, """ class X{ void f() { int x=0;x++; Runnable r = new Runnable() { public void run() { <caret> }}; <selection>int y = x;</selection> \s } }"""); assertEmpty(highlightErrors()); PlatformTestUtil.invokeNamedAction(IdeActions.ACTION_EDITOR_COPY); assertEquals("int y = x;", getEditor().getSelectionModel().getSelectedText()); getEditor().getSelectionModel().removeSelection(); PlatformTestUtil.invokeNamedAction(IdeActions.ACTION_EDITOR_PASTE); assertOneElement(highlightErrors()); }