@NotNull
  private <S> List<S> filterUniqueByWorkingCopy(@NotNull List<? extends S> in,
                                                @NotNull Function<? super S, ? extends VirtualFile> convertor) {
    Map<VirtualFile, S> filesMap = StreamEx.of(in).<VirtualFile, S>mapToEntry(convertor, identity()).distinctKeys().toMap();
    Map<VirtualFile, List<VirtualFile>> byWorkingCopy =
      StreamEx.of(filesMap.keySet())
        .mapToEntry(
          file -> {
            RootUrlInfo wcRoot = getSvnFileUrlMapping().getWcRootForFilePath(getFilePath(file));
            return wcRoot != null ? wcRoot.getVirtualFile() : SvnUtil.getWorkingCopyRoot(file);
          },
          identity())
        .nonNullKeys()
        .grouping();

    return EntryStream.of(byWorkingCopy)
      .flatMapToValue((workingCopy, files) -> {
        FilterDescendantVirtualFiles.filter(files);
        return files.stream();
      })
      .values()
      .map(filesMap::get)
      .toList();
  }
@NotNull
  private <S> List<S> filterUniqueByWorkingCopy(@NotNull List<? extends S> in,
                                                @NotNull Function<? super S, ? extends VirtualFile> convertor)