void () { final Document document = EditorFactory.getInstance().createDocument("[xxxxxxxxxxxxxx]"); RangeMarker m1 = document.createRangeMarker(2, 4); RangeMarker m2 = document.createRangeMarker(2, 4); assertEquals(2, ((DocumentImpl)document).getRangeMarkersSize()); assertEquals(1, ((DocumentImpl)document).getRangeMarkersNodeSize()); RangeMarker m3 = document.createRangeMarker(2, 5); assertEquals(2, ((DocumentImpl)document).getRangeMarkersNodeSize()); deleteString(document, 4, 5); assertTrue(m1.isValid()); assertTrue(m2.isValid()); assertTrue(m3.isValid()); assertEquals(1, ((DocumentImpl)document).getRangeMarkersNodeSize()); m1.setGreedyToLeft(true); assertTrue(m1.isValid()); assertEquals(3, ((DocumentImpl)document).getRangeMarkersSize()); assertEquals(2, ((DocumentImpl)document).getRangeMarkersNodeSize()); m3.dispose(); assertTrue(m1.isValid()); assertTrue(m2.isValid()); assertFalse(m3.isValid()); assertEquals(2, ((DocumentImpl)document).getRangeMarkersSize()); assertEquals(2, ((DocumentImpl)document).getRangeMarkersNodeSize()); }