The question is as simple as the title. How to check in Groovy that object is a list or collection or array? But can\'t find a simple way of checking it. Any ideas?
Usually you'd want to check its behavior with duck typing.
def foo = someMethod() if (foo.metaClass.respondsTo('each')) { foo.each {println it} }