List<VirtualFile> (@NotNull VirtualFile psiDirectory, @NotNull List<VirtualFile> children, List<VirtualFile> dirsToBeRemoved, @NotNull VirtualFile _directory) { if (children.remove(psiDirectory)) { if (children.size() == 0) { if (dirsToBeRemoved == null) { dirsToBeRemoved = new ArrayList<>(2); } dirsToBeRemoved.add(_directory); // we have remove empty _directory } } return dirsToBeRemoved; }