I've tried:
groovy:000> Set<String> s = ["a", "b", "c", "c"]
===> [a, b, c]
groovy:000> s
Unknown property: s
I want to be able to use this as a set, but even if I pass it explicitly, it turns it into an ArrayList:
groovy:000> joinList(["a", "b", "c", "c"])
ERROR groovy.lang.MissingMethodException:
No signature of method: groovysh_evaluate.joinList() is applicable for argument types: (java.util.ArrayList) values: [[a, b, c, c]]
Possible solutions: joinList(java.util.Set)
["a", "b", "c", "c"] as Set
made my unit tests fail, but["a", "b", "c", "c"].toSet()
is working fine. I'm using Spock. – Patrycja K Oct 17 '16 at 14:09