loop customer with handler function
Sat Jan 29 2022 09:03:32 GMT+0000 (Coordinated Universal Time)
Saved by
@Shuhab
public class Customer {
private String name;
private int points;
public boolean hasOverHundredPoints() {
return this.points > 100;
}
}
public class Customers {
public List<Customer> getCustomers(){
return this.customers
.stream()
.filter(Customer::hasOverHundredPoints)
.collect(Collectors.toList());
}
}
content_copyCOPY
Comments