I've noticed many functionalities exposed in Stream are apparently duplicated in Collectors, such as Stream.map(Foo::bar)
versus Collectors.mapping(Foo::bar, ...)
, or Stream.count()
versus Collectors.counting()
. What's the difference between these approaches? Is there a performance difference? Are they implemented differently in some way that affects how well they can be parallelized?