@Contract(pure = true)
  public static @Unmodifiable @NotNull <T> List<T> mergeSortedLists(@NotNull List<? extends T> list1,
                                                                    @NotNull List<? extends T> list2,
                                                                    @NotNull Comparator<? super T> comparator,
                                                                    boolean mergeEqualItems) {
    List<T> result = new ArrayList<>(list1.size() + list2.size());
    processSortedListsInOrder(list1, list2, comparator, mergeEqualItems, (t, __) -> result.add(t));
    return result;
  }
@Contract(pure = true)
  public static @Unmodifiable @NotNull <T> List<T> mergeSortedLists(@NotNull List<? extends T> list1,
                                                                    @NotNull List<? extends T> list2,
                                                                    @NotNull Comparator<? super T> comparator,
                                                                    boolean mergeEqualItems)