Why autoboxing does not work with Predicate

87 views Asked by At

I have this code:

System.out.println(test( (int i) -> i == 5) ); // Error here

System.out.println(test( (Integer i) -> i == 5) ); // No error here

private static boolean test(Predicate<Integer> p) {
  return p.test(5);
}
0

There are 0 answers