void () { @Language("JAVA") String text = "class X{}"; PsiFile file = configureByText(JavaFileType.INSTANCE, text); PsiClass aClass = ((PsiClassOwner)file).getClasses()[0]; SmartPointerManagerImpl smartPointerManager = getPointerManager(); SmartPsiElementPointerImpl pointer1 = (SmartPsiElementPointerImpl)createPointer(aClass); for (int i=0; i<1000; i++) { SmartPsiElementPointer<PsiClass> pointer2 = createPointer(aClass); assertSame(pointer1, pointer2); } assertNotNull(pointer1.getRange()); assertEquals(Byte.MAX_VALUE, pointer1.incrementAndGetReferenceCount(0)); for (int i=0; i<1100; i++) { smartPointerManager.removePointer(pointer1); Assert.assertNotNull(pointer1.getRange()); } }