The Groovy "in" operator seems to mean different things in different cases. Sometimes x in y
means y.contains(x)
and sometimes it seems to call y.isCase(x)
.
How does Groovy know which one to call? Is there a particular class or set of classes that Groovy knows about which use the .contains method? Or is the behavior triggered by the existence of a method on one of the objects? Are there any cases where the in operator gets changed into something else entirely?