What’s wrong with what we’ve been doing?
A statement might be true at some point, but false later on
Functional Interfaces
“Take a T and return true or false”
Predicate<Person> isAnAdult = (person) -> person.age() >= 18;
boolean isAnAdult(Person person) {
return person.age() > 18);
}
“Take a T and return an R”
“Take a UUID and return a User”
Frag 1 Frag 2