- 该错误表示key重复,只需要指定key重复时使用那个即可
Map<Long, DistributorAftersalesAddressEntity> distributorAftersalesAddressMap = distributorAftersalesAddressEntityList
.stream().collect(Collectors.toMap(DistributorAftersalesAddressEntity::getDistributorId, Function.identity()));
Map<Long, DistributorAftersalesAddressEntity> distributorAftersalesAddressMap = distributorAftersalesAddressEntityList
.stream()
.collect(Collectors.toMap(
DistributorAftersalesAddressEntity::getDistributorId,
Function.identity(),
(v1, v2) -> v1
));