title: How does the Groovy in operator work?
body: <p>The Groovy "in" operator seems to mean different things in different cases.  Sometimes <code>x in y</code> means <code>y.contains(x)</code> and sometimes it seems to call <code>y.isCase(x)</code>.</p>
  
  <p>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?</p>