void () { final VirtualFile dir = createChildDirectory(myPrjDir1, "dir"); VirtualFile dir1 = createChildDirectory(dir, "dir1"); VirtualFile file = createChildData(dir1, "a.txt"); FileManagerImpl fileManager = (FileManagerImpl)myPsiManager.getFileManager(); fileManager.findFile(file); WriteCommandAction.writeCommandAction(getProject()).run(() -> delete(dir)); fileManager.checkConsistency(); }