How can I check if 2 lambda's run the same code? Suppose I have the following code:
main() {
Predicate<Person> a = (person -> person.getAge() > 18);
Predicate<Person> b = (person -> person.getAge() > 18);
boolean x = equalLamdbaCode(a, b)); // should return true
Predicate<Person> c = (person -> person.getAge() > 40);
boolean y = equalLamdbaCode(a, c)); // should return false
}
Is there a reliable way to implement that equalLamdbaCode(a, b)
method?