public static <T, K, U, M extends Map<K, U>> Collector<T, ?, M> toMap( Function<? super T, ? extends K> keyMapper, Function<? super T, ? extends U> valueMapper, Supplier<M> mapSupplier) { return Collectors.toMap( keyMapper, valueMapper, throwingMerger(), mapSupplier ); }