void () { initText(""); // Cannot set up text with singular surrogate characters directly runWriteCommand(() -> getEditor().getDocument().setText(LOW_SURROGATE + HIGH_SURROGATE)); Inlay inlay = addInlay(2); FoldRegion region = addCollapsedFoldRegion(1, 2, "..."); runWriteCommand(() -> ((DocumentEx)getEditor().getDocument()).moveText(1, 2, 0)); assertFalse(inlay.isValid() && inlay.getOffset() == 1); assertFalse(region.isValid() && (region.getStartOffset() == 1 || region.getEndOffset() == 1)); }