groceries = ["Milk", "Sugar"]
groceries << "Bread"

println "Last item in the list: ${groceries[-1]}"

println("List of items:");
groceries.eachWithIndex { e, i ->
  println "$i\t$e"
}

println("Sorted items");
groceries.clone().sort().each { println it }

print("The items are: ");
println groceries.join(', ')