void () { Document doc = new DocumentImpl("text"); RangeMarker normal = doc.createRangeMarker(1, 3); RangeMarker persistent = doc.createRangeMarker(1, 3, true); replaceString(doc, 0, 4, "before\ntext\nafter"); assertTrue(persistent.isValid()); assertFalse(normal.isValid()); }