functional programming and closures hacks for Java