require 'java' import 'HighFunction' # make sure HighFunction.class & HighFunction$.class are in your path HighFunction.foo(10) { |n| n * 2 } #=> 20