“In” Keyword -Groovy
keyword "in" is used in Groovy to check whether element exists in Collection. Example List [groovy] String str = "this is me " List list = str.tokenize(" ") String word = "this" assert word in list == true assert "hello" in list == false [/groovy] Example with Set [groovy] Set set = ["this","is","me"] String word = "this" assert word in set == true assert "hello" in set == false [/groovy]