private void doCreateChildren(@NotNull DirectoryEntry parent, @NotNull Iterable<? extends VirtualFile> children, boolean forDeletion,
                                @Nullable FileTreeVisitor visitor) {
    List<Entry> entries = ContainerUtil.mapNotNull(children, each -> {
      if (visitor != null && !visitor.before(each)) return null;

      Entry newEntry = null;
      Entry existingEntry = parent.findEntry(each.getName());
      if (existingEntry != null) {
        if (existingEntry instanceof DirectoryEntry existingDirectoryEntry) {
          doCreateChildren(existingDirectoryEntry, iterateDBChildren(each), forDeletion, visitor);
        }
      }
      else {
        newEntry = doCreateEntry(each, forDeletion, visitor);
      }

      if (visitor != null) visitor.after(each);

      return newEntry;
    });
    parent.addChildren(entries);
  }
private void doCreateChildren(@NotNull DirectoryEntry parent, @NotNull Iterable<? extends VirtualFile> children, boolean forDeletion,
                                @Nullable FileTreeVisitor visitor)