Map<Integer,List<ItemTypeA>> list = data.stream().collect(groupingBy(ItemTypeA::getId));
I have a function that converts ItemTypeA to ItemTypeB.
public ItemTypeB convert (ItemTypeA);
How can I use this after groupingByhere, so that the end result will be as shown below.
Map<Integer,List<ItemTypeB>> map = data.stream().collect(groupingBy(ItemTypeA::getId),
How to call a function to convert ItemTypeAto ItemTypeB?;
source
share