private static List<VirtualFile> collectDirsToRemove(@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;
  }
private static List<VirtualFile> collectDirsToRemove(@NotNull VirtualFile psiDirectory,
                                                       @NotNull List<VirtualFile> children,
                                                       List<VirtualFile> dirsToBeRemoved,
                                                       @NotNull VirtualFile _directory)