void () { File fileToDelete = tempDir.newFile("toDelete.txt"); LoggingListener fileToDeleteListener = new LoggingListener(); VirtualFilePointer fileToDeletePointer = createPointerByFile(fileToDelete, fileToDeleteListener); assertTrue(fileToDeletePointer.isValid()); VirtualFile file = fileToDeletePointer.getFile(); assertNotNull(file); VirtualFile parent = file.getParent(); VfsTestUtil.deleteFile(getVirtualFile(fileToDelete)); assertFalse(fileToDeletePointer.isValid()); assertEquals("[before:true, after:false]", fileToDeleteListener.log.toString()); fileToDeleteListener.log.clear(); VfsTestUtil.createFile(parent, fileToDelete.getName()); assertTrue(fileToDeletePointer.isValid()); assertEquals("[before:false, after:true]", fileToDeleteListener.log.toString()); }