You can write code like:
List<MyObject> mylist = new HashSet<Integer>() {{ add("string"); add(1L); }}
You will get groovy.lang.GroovyRuntimeException with constructor issues.
You can write code like:
List<MyObject> mylist = new HashSet<Integer>() {{ add("string"); add(1L); }}
You will get groovy.lang.GroovyRuntimeException with constructor issues.