def numbers = [1,2,3] assert numbers //true, as numbers in not empty numbers =  assert !numbers //false, as numbers is now an empty collection
Iterators and Enumerations
Iterators and Enumerations with no further elements are coerced to false.
assert !.iterator() // false because the Iterator is empty assert .iterator() // true because the Iterator has a next element def v = new Vector() assert !v.elements() // false because the Enumeration is empty v.add(new Object()) assert v.elements() // true because the Enumeration has more elements
Non-empty maps are coerced to true.