This question my be a very primitive question with Java 8 collections.
How can I understand better how Java 8 passes input values between various stages within stream processing. If there is documentation explaining this clearly I am happy to read through, but I couldn't come across any.
For example, the groupingBy takes in a Function called classifier, this take in T type and transforms to K type.
static <T,K> Collector<T,?,Map<K,List<T>>>
groupingBy(Function<? super T,? extends K> classifier)
In the below example, we are passing on only type K. It is not clear when in streams the input values (Type T) will be automatically considered? How can I understand this better?
Map<BlogPostType, List<BlogPost>> postsPerType = posts.stream()
.collect(groupingBy(BlogPost::getType));