Groovy Switch statement with list of values
<p>I want to use Switch statement in Jenkins pipeline job. </p>

<pre><code>def version = "1.2"
switch(GIT_BRANCH) {
  case "develop":
    result = "dev"
    break
  case ["master", "support/${version}"]:
    result = "list"
    break
  case "support/${version}":
    result = "sup"
    break
  default:
    result = "def"
    break
}
echo "${result}"
</code></pre>

<p>When <code>GIT_BRANCH</code> is equal to:</p>

<ul>
<li><code>develop</code> - returned value is <code>dev</code> - OK</li>
<li><code>master</code> - returned value is <code>list</code> - OK</li>
<li><code>support/1.2</code> - returned value is <code>sup</code> - why not <code>list</code>?</li>
</ul>