The type of the array parameter of Collection.toArray needs to be compatible with the array type

See: https://errorprone.info/bugpattern/CollectionToArraySafeParameter