Three signatures are proposed:
// collapse elements with the same key gathering corresponding values to list
EntryStream<k list>> collapseKeys();
// collapse elements with the same key reducing the values with given mergeFunction
EntryStream<k v> collapseKeys(BinaryOperator<v> mergeFunction);
// collapse elements with the same key reducing the values with given Collector
<a r> EntryStream<k r> collapseKeys(Collector<v a r> collector);
</v></k></a></v></k></k>
- [x] Implementation
- [x] Tests
- [x] JavaDoc
- [x] Changes
- [x] Cheatsheet
该提问来源于开源项目:amaembo/streamex