Find java
1. Find the set
userList.stream().filter(e->e.getId().equals(userCard.getUserId())).findFirst().get().getPhone();
Careful users may find the above code has a bug collection to find it will complain when found.
Modifications to see the second one.
2. Find a collection of objects that match. And take the first phone assigned to the new object
userList.stream().filter(e->e.getId().equals(userCard.getUserId())).findFirst().ifPresent (a->{
newInfo.setPhone(a.getPhone());
});
3. Take a field set list
List<Integer> integerList =projectList.stream().map(e -> e.getId()).collect(Collectors.toList());