private static @NotNull @Nls <F> String getText(@NotNull Collection<? extends F> files,
                                                  @Nls @NotNull String categoryText,
                                                  @NotNull Comparator<? super F> comparator,
                                                  @NotNull NotNullFunction<? super F, @Nls String> getText,
                                                  boolean full) {
    if (full) {
      return ALL_ACTION_TEXT.get();
    }
    else if (files.isEmpty()) {
      return categoryText;
    }
    else {
      F firstFile = Collections.min(files, comparator);
      String firstFileName = getText.fun(firstFile);
      if (files.size() == 1) {
        return firstFileName;
      }
      return firstFileName + " + " + (files.size() - 1);
    }
  }
private static @NotNull @Nls <F> String getText(@NotNull Collection<? extends F> files,
                                                  @Nls @NotNull String categoryText,
                                                  @NotNull Comparator<? super F> comparator,
                                                  @NotNull NotNullFunction<? super F, @Nls String> getText,
                                                  boolean full)