1717 * @param <V> the value element type
1818 * @param <M> the resulting map type
1919 */
20- public final class ToMap <K , V , M extends Map <K , V >> implements Fn2 <Supplier <M >, Iterable <Map .Entry <K , V >>, M > {
20+ public final class ToMap <K , V , M extends Map <K , V >> implements Fn2 <Supplier <M >, Iterable <? extends Map .Entry <K , V >>, M > {
2121
2222 private static final ToMap INSTANCE = new ToMap <>();
2323
2424 private ToMap () {
2525 }
2626
2727 @ Override
28- public M apply (Supplier <M > mSupplier , Iterable <Map .Entry <K , V >> entries ) {
28+ public M apply (Supplier <M > mSupplier , Iterable <? extends Map .Entry <K , V >> entries ) {
2929 return foldLeft ((m , kv ) -> {
3030 m .put (kv .getKey (), kv .getValue ());
3131 return m ;
@@ -37,11 +37,12 @@ public static <K, V, M extends Map<K, V>> ToMap<K, V, M> toMap() {
3737 return INSTANCE ;
3838 }
3939
40- public static <K , V , M extends Map <K , V >> Fn1 <Iterable <Map .Entry <K , V >>, M > toMap (Supplier <M > mSupplier ) {
40+ public static <K , V , M extends Map <K , V >> Fn1 <Iterable <? extends Map .Entry <K , V >>, M > toMap (Supplier <M > mSupplier ) {
4141 return ToMap .<K , V , M >toMap ().apply (mSupplier );
4242 }
4343
44- public static <K , V , M extends Map <K , V >> M toMap (Supplier <M > mSupplier , Iterable <Map .Entry <K , V >> entries ) {
44+ public static <K , V , M extends Map <K , V >> M toMap (Supplier <M > mSupplier ,
45+ Iterable <? extends Map .Entry <K , V >> entries ) {
4546 return toMap (mSupplier ).apply (entries );
4647 }
4748}
0 commit comments