void () { psiFile = createFile("x.txt", "xxx"); LazyRangeMarkerFactoryImpl factory = (LazyRangeMarkerFactoryImpl)LazyRangeMarkerFactory.getInstance(getProject()); VirtualFile virtualFile = psiFile.getVirtualFile(); RangeMarker marker = factory.createRangeMarker(virtualFile, 0); assertTrue(marker.isValid()); assertEquals(0, marker.getStartOffset()); marker.dispose(); assertFalse(marker.isValid()); marker = factory.createRangeMarker(virtualFile, 0); assertTrue(marker.isValid()); assertEquals(0, marker.getStartOffset()); Document document = marker.getDocument(); insertString(document, 2, "yyy"); assertTrue(marker.isValid()); assertEquals(0, marker.getStartOffset()); marker.dispose(); }