Java 8 and lambda calculus equivalent
Your solutions for identity and application are correct. If wouldn't define them as functions however, I find x->x
and Function::apply
as readable as identity()
and apply()
, so I would simply use them directly.
As for self-application, well, as you note Java is typed, and also in typed lambda calculus self-application is impossible (at least in all typed lambda calculi I know). You can produce something by using raw types (like you did), but then you essentially throw away the part of the type system.
But also, why do you need all this?