Having done some tests, I found if the lambda parameter is primitive and it requires the primitive's wrapping class, the compiler will complain, however, if the lambda return a primitive's wrapping class, but actually return a primitive, the compiler doesn't show any issue.
Is it true that the auto boxing is now allowed for lambda parameter?
Please see the question below:
the IntFunction<Integer> requires an int type parameter, return an Integer Object, but we can't pass in Integer Object as parameter whereas return an int type is allowed.
You aren't going to like this answer, but "it depends." If the compiler can infer with the boxing, it is allowed. If the boxing makes the lambda ambiguous, the compiler throws up its hands in despair and makes you clarify.