, Closures mocks, . , , , Expando Map. , , , , , , .
interface Foo {
def someMethod(s)
}
// Closure, this breaks if someOtherMethod() is added to Foo or if Foo is a class
def mockMethod = { arg -> ...}
def myTestObject = new ObjectUnderTest(mockMetod as Foo)
// Map
def mockMethod = { arg -> ...}
def myTestObject = new ObjectUnderTest([someMethod:mockMethod] as Foo)
, Map Expando , - , Expando.