Say I have a List addressees, and the properties for the address are
1. ID
2. Name
3. State
Then I have a get method to get an address by ID
public Address get(Integer id) {
for (Address myAddress : addresses) {
if (myAddress.getId() == id) {
return myAddress;
}
}
return null;
}
This is how it would look without lambdas
How do I return the address using lambdas?