void () { initText(""); // Cannot set up text with singular surrogate characters directly runWriteCommand(() -> getEditor().getDocument().setText(HIGH_SURROGATE + LOW_SURROGATE + LOW_SURROGATE)); getEditor().getCaretModel().moveToOffset(2); runWriteCommand(() -> ((DocumentEx)getEditor().getDocument()).moveText(2, 3, 1)); assertFalse(DocumentUtil.isInsideSurrogatePair(getEditor().getDocument(), getEditor().getCaretModel().getOffset())); }