You are not describing the test method which is in the Predicate functional interface. Here I think the Climb functional interface is used.
In this the lambda expression (h,l)->h>l is the method istooHight.
it returns true if height>limit. and you are passing the value of height to be 5. In the check method signature, second parameter is height.
In this expression if(climb.isTooHight(height, 10)), the second parameter to the isTooHight method is 10. If you look at the method signature of isTooHight, the second parameter is limit. and the first parameter height is 5, it is being got as the local variable height in the check method.
height is 5 and limit is 10 . so 5>10 returns false. so it happens like this.
If you do an SOP in the check method, you can find out.
posted 4 years ago
Thanks a lot Ramya.
Now I see that the lambda ((h,l)->h>l) is the first parameter of check method, and the other parameter is value of height which is set to 5.
That 5 confused me and I thought it was in the body of lambda expression. In fact it is the second parameter.