void () { StringBuilder buffer = new StringBuilder("0123456789"); RangeMarker marker = createMarker(buffer.toString(), 2, 5); WriteAction.run(() -> { synchronizer.startTransaction(getProject(), document, psiFile); synchronizer.insertString(document, 1, "a"); buffer.insert(1, "a"); synchronizer.replaceString(document, 3, 4, "a"); buffer.replace(3, 4, "a"); synchronizer.commitTransaction(document); assertEquals(buffer.toString(), document.getText()); assertValidMarker(marker, 3, 6); }); }