This code could be successfully compiled and executed.
Looks like type check in groovy doesn't work with captured types. Is it a bug?
Is there any documentation about generics in groovy?
Another kind of strange behaviour:
Somehow type checking infered type of 'captured' variable to java.util.ArrayList <java.lang.Integer>