void printFirstNames(List<Person> people) {
    
  println "There are ${people?.size()?: "no"} people."

  if(!people) return

  println "Their first names are: ${people*.firstName.join(', ')}"
}

def people = []
people << new Person("John", "Smith", 27)
people << new Person("Sara", "Smith", 27)
people << new Person("Bill", "Smith", 7)
people << new Person("Kate", "Smith", 6)
printFirstNames(people)
printFirstNames([])