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