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