Skip to content

Tag: predicate

Unable to get my head around Predicate isEqual method

In Java docs it is given – In https://www.geeksforgeeks.org/java-8-predicate-with-examples/ it is given – isEqual(Object targetRef) : Returns a predicate that tests if two arguments are equal according to Objects.equals(Object, Object). static Predicate isEqual(Object targetRef) Returns a predicat…

Java Predicates with distributive law

I have a boolean Java statement that is structured like follows: return A AND (B OR C OR D) In Java: I wanted to reformulate this by using chained predicates, but it seems like I have to use the distributive law of Boolean algebra in order to make it work: (A AND B) OR (A AND C) OR (A AND