void () { PsiJavaFile file = (PsiJavaFile)myJavaFacade.findClass("AClass", GlobalSearchScope.allScope(getProject())).getContainingFile().copy(); SmartPsiFileRange pointer = getPointerManager().createSmartPsiFileRangePointer(file, TextRange.create(1, 2)); insertString(file.getViewProvider().getDocument(), 0, " "); assertEquals(TextRange.create(2, 3), pointer.getRange()); PsiDocumentManager.getInstance(myProject).commitAllDocuments(); assertEquals(TextRange.create(2, 3), pointer.getRange()); }