public static <T,K,D,A,M extends Map<K,D>> Collector<T,?,M> groupingBy(Function<? super T,? extends K> classifier,
Supplier<M> mapFactory,
Collector<? super T,A,D> downstream)
T - the type of the input elements
K - the type of the keys
A - the intermediate accumulation type of the downstream collector
D - the result type of the downstream reduction
M - the type of the resulting Map
classifier - a classifier function mapping input elements to keys(从元素中提取key)
mapFactory - a function which, when called, produces a new empty Map of the desired type(提供返回的容易,一般都是map)
downstream - a Collector implementing the downstream reduction(value的聚合方式)
参考:
https://blog.csdn.net/xiaolulululululu/article/details/101378439