void () { configureFromFileText("x.txt", "xxx<caret>\nyyy"); type(' '); FocusEvent event = new FocusEvent(getEditor().getContentComponent(), 1005); FocusListener[] listeners = getEditor().getContentComponent().getListeners(FocusListener.class); for (FocusListener listener : listeners) { listener.focusLost(event); } stripTrailingSpaces(); checkResultByText("xxx <caret>\nyyy"); }