List<Customer> customers = findAllCustomer();
public class Customer implements Serializable {
private State state;
//getter and setter
I have below approached using jdk 7
List<State> states = new ArrayList<>();
for (Customer customer : customers) {
states.add(customer.getState());
}
How can I achieve the same thing using jdk 8?