Closure-Based Interface Implementation
If you have a typed reference such as:
MyInterface foo
You can implement the entire interface using:
foo = {Object[] args -> println "This closure will be called by ALL methods"} as MyInterface
Alternatively, if you want to implement each method separately, you can use:
foo = [bar: {-> println "bar invoked"},
baz: {param1 -> println "baz invoked with param $param1"}] as MyInterface