void () { VirtualFile mockVirtualFile = new MockVirtualFile("test_name", "test_text"); Disposable disposable = Disposer.newDisposable(); VirtualFilePointer pointer = myVirtualFilePointerManager.create(mockVirtualFile, disposable, null); assertThat(pointer).isInstanceOf(IdentityVirtualFilePointer.class); assertTrue(pointer.isValid()); VirtualFile virtualFileWithSameUrl = new MockVirtualFile("test_name", "test_text"); VirtualFilePointer updatedPointer = myVirtualFilePointerManager.create(virtualFileWithSameUrl, disposable, null); assertThat(updatedPointer).isInstanceOf(IdentityVirtualFilePointer.class); assertTrue(pointer.isValid()); assertEquals(1, myVirtualFilePointerManager.numberOfCachedUrlToIdentity()); Disposer.dispose(disposable); assertEquals(0, myVirtualFilePointerManager.numberOfCachedUrlToIdentity()); }