I wanted to know why we classify certain collectors as "downstream"? Is there an upstream Collector then? Please note that this is not about usage, but trying to understand the logic behind the term "downstream". To me, when you normally deal with stream API usage, all streams down the builder chain looks like they are downstream only.
List<String> list = List.of("AAA","B","CCCCC","DDD", "FFFFFF", "AAA");
List<Integer> res =
list.stream()
.collect(
Collectors.mapping(s -> s.length(), // string -> int
Collectors.toList())); // downstreaming
In the above code, Collectors.toList() is regarded as downstream.