java. Replaced InvocationChainHandler with a Function, fixed #101.