void () { initText(""); // Cannot set up text with singular surrogate characters directly runWriteCommand(() -> getEditor().getDocument().setText(HIGH_SURROGATE + LOW_SURROGATE + LOW_SURROGATE)); Inlay<?> inlay = addInlay(2); assertNotNull(inlay); assertTrue(inlay.isValid()); runWriteCommand(() -> ((DocumentEx)getEditor().getDocument()).moveText(2, 3, 1)); assertFalse(inlay.isValid() && DocumentUtil.isInsideSurrogatePair(getEditor().getDocument(), inlay.getOffset())); }