private static @NotNull @NlsContexts.Tooltip <F> HtmlChunk getTooltipTextForFiles(@NotNull Collection<? extends F> files,
                                                                                    @NotNull Comparator<? super F> comparator,
                                                                                    @NotNull Function<? super F, @NotNull @Nls String> getText,
                                                                                    @NotNull HtmlChunk separator) {
    List<F> filesToDisplay = ContainerUtil.sorted(files, comparator);
    filesToDisplay = ContainerUtil.getFirstItems(filesToDisplay, 10);
    HtmlBuilder tooltip = new HtmlBuilder().appendWithSeparators(separator,
                                                                 ContainerUtil.map(filesToDisplay, f -> HtmlChunk.text(getText.apply(f))));
    if (files.size() > 10) {
      tooltip.append(separator).append("...");
    }
    return tooltip.toFragment();
  }
private static @NotNull @NlsContexts.Tooltip <F> HtmlChunk getTooltipTextForFiles(@NotNull Collection<? extends F> files,
                                                                                    @NotNull Comparator<? super F> comparator,
                                                                                    @NotNull Function<? super F, @NotNull @Nls String> getText,
                                                                                    @NotNull HtmlChunk separator)