Here, a reference to the static method isPrime( ) is passed as the first argument to numTest( ).
This works because isPrime is compatible with the IntPredicate functional interf
This is an example of lambdas at work. It is new in java 8 and it basically allows the runtime to create an instance of the functional interface for you with the implementation you define.
Brian Goetz has written a doc on how lambdas (and method references) work at compile and runtime.