I have a list of Data object
public class Data{
private String id;
private String sharedId;
}
How to convert this list into Map<String,List<Data>>, collecting the data object sharing the same sharedId together
I have tried to use this line of code, but no luck
Map<String,List<Data>> dataMap= Flux.fromIterable(list)
.collectMap(item-> item.getSharedId(),
item-> item);