// your code goes here def list = [] println list; println list.sort{it}.last(); println working
Standard input is empty
[]
Caught: java.util.NoSuchElementException: Cannot access last() element from an empty List java.util.NoSuchElementException: Cannot access last() element from an empty List at prog.run(prog.groovy:6)