java stream 将List转换成Map
userList.stream().collect(Collectors.toMap(User::getId, User::getName));
userList.stream().collect(Collectors.toMap(User::getId, t -> t));
for (User user : list) {
Set<Integer> addressesIds = addressesList.stream().map(Address::getId).collect(Collectors.toSet());
if (addressesIds.contains(user.getAddress())){
String s = addressMap.get(user .getAddress());
user .setAddressName(s);
}
}