implement the remaining closures to support groovy and add groovy examples