void () { final var file = tempDir.newFile("myfile.txt"); // avoiding root resolve in tempDir // otherwise there will be an exception on its remove using VirtualFile final var pointer = myVirtualFilePointerManager.create( LocalFileSystem.getInstance().refreshAndFindFileByIoFile(file), disposable, null ); assertTrue(pointer.isValid()); assertNotNull(pointer.getFile()); CacheSwitcher.INSTANCE.switchIndexAndVfs( null, null, "resetting vfs", () -> { ((VirtualFilePointerManagerImpl)VirtualFilePointerManager.getInstance()).assertUrlBasedPointers(); assertFalse(pointer.isValid()); assertNull(pointer.getFile()); return null; } ); assertTrue(pointer.isValid()); assertNotNull(pointer.getFile()); }