一、list对象根据ID个字段转为list
List userEntitys=new ArrayList<>();
List list =userEntitys.stream().map(UserEntity::getId).collect(Collectors.toList());
二、list对象转化为map key 和value都为指定字段
Map<String, String> collect = list.stream().collect(Collectors.toMap(UserEntity::getId, UserEntity::getAccount, (oldValue, newValue) -> newValue));