If you really want to create an array rather than a list use either
String[] names = ["lucas", "Fred", "Mary"]
or
def names = ["lucas", "Fred", "Mary"].toArray()
@SafeVarargs
Is a cure for the warning: [unchecked] Possible heap pollution from parameterized vararg type Foo.
Is part of the method's contract, hence why the annotation has runtime retention.
Is a promise to the caller of the method that the method will not mess up the heap using the generic varargs argument.