code: public <M extends Map<K, V>> M toCustomMap(BinaryOperator<V> mergeFunction, Supplier<M> mapSupplier) {
          Function<Entry<K, V>, K> keyMapper = Entry::getKey;
          Function<Entry<K, V>, V> valueMapper = Entry::getValue;
          return collect(Collectors.toMap(keyMapper, valueMapper, mergeFunction, mapSupplier));
      }
docs: Returns a {@link Map} containing the elements of this stream. The
  {@code Map} is created by a provided supplier function.
  
  <p>
  If the mapped keys contains duplicates (according to
  {@link Object#equals(Object)}), the value mapping function is applied to
  each equal element, and the results are merged using the provided merging
  function.
  
  <p>
  This is a <a href="package-summary.html#StreamOps">terminal</a>
  operation.
  
  @param <M> the type of the resulting map
  @param mergeFunction a merge function, used to resolve collisions between
  values associated with the same key.
  @param mapSupplier a function which returns a new, empty {@code Map} into
  which the results will be inserted
  @return a {@code Map} containing the elements of this stream
  @see Collectors#toMap(Function, Function)
  @see Collectors#toConcurrentMap(Function, Function)