So I have a list of integer that is insIds, from this I can get a list of ABCs, I want to map them to an entry in map (notice that we can not getInsId from Abc.getIns)
This is what I want it to be: (but since we do not have getInsId we are not able to write this way)
Map<Integer, Integer> insIdToAbcId = abcController
.findAbcsByInsIds(insIds)
.stream()
.collect(Collectors.toMap(Abc::getInsId,
Abc::getAbcId));
I am not sure how to write it in order to have the mapping relationship I want.
Known list of integer: insIds
Known function that will take insIds and return list:
abcController.findAbcsByInsIds(insIds)
And then is what I am not sure about: how to map insId to AbcId
(expect output: Map<Integer, Integer> insIdToAbcId
)