What is the difference between both these ways of lambda creation? Why doesn't the first one compile?
Predicate<Integer> predicate = Predicate.isEqual(0).or(Predicate.isEqual(1));
Gives:
error: incompatible types: Predicate<Object>
cannot be converted to Predicate<Integer> = Predicate.isEqual(0).or(Predicate.isEqual(1));
Predicate<Integer> pred21 = Predicate.isEqual(0);
Predicate<Integer> pred22 = pred21.or(Predicate.isEqual(1));
This one works.