Groovy web console

subscribe to the feed Subscribe
to this
site
Collection gotcha (via #groovywebconsole)
tweet this snippet Tweet
this
script

Collection gotcha

Published 2 months ago by Konstantyn
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
class A {
  String name
}

def list = [ 'a', 'b', 'c', 'd' ].collect{ new A( name:it ) } as Set

assert 1 == list.size()