You cannot pass function pointers or anything like that in Java® ...
but you can create a functional interface and instantiate it from a λ
Start by going through the code for a well‑known functional interface from the Java standard installation; there is a file called src.zip inside your instillation folder. Unxip it and go java→util→concurrent→Callable.java and you should find the code for this. Read the actual code rather than the comments. Now you know the sort of thing you want to write in your .java file.Now you can pass that λ to a method taking a Foo parameter and Bob's your uncle
I suggest you search for tutorials about λs. You should find something in the Java™ Tutorials.