The groovy way to see if something is in a list is to use \"in\"
if(\'b\' in [\'a\',\'b\',\'c\'])
However how do you nicely see if something
More readable, I'm not sure:
assert ['a','b','c'].any{it == 'b'}
assert ['a','b','c'].every{it != 'g'}
For your example:
if (['a','b','c'].every{it != 'g'})
A few months ago, I suggested a new operator overloading ! (not operator). Now, maybe you can use any odd number of exclamations ;)
if(!!!('g' in ['a','b','c']))