groovy Closures Converting Methods to Closures


Example

A method can be converted to a closure using the & operator.

def add(def a, def b) { a + b }    

Closure addClosure = this.&add
assert this.add(4, 5) == addClosure(4, 5)