Java8: solve the problem of Duplicate key when converting List to Map

Get a List collection containing objects, and then select two properties. When performing List conversion to Map, the following error is reported: java.lang.IllegalStateException: Duplicate key Possible problems Originally, I wanted to solve this problem by adding formal parameters (entity1, entity2) - > entity1), but I still want to sol ...

Posted by kkonline on Mon, 22 Nov 2021 15:45:50 -0800