Ported to hydro (also should work with groovy)