public static String[] toStringArray(@Nullable Collection<String> collection) {
        return (!CollectionUtils.isEmpty(collection) ? collection.toArray(EMPTY_STRING_ARRAY) : EMPTY_STRING_ARRAY);
    }
Copy the given {link Collection} into a {@code String} array.
<p>The {@code Collection} must contain {@code String} elements only.

@param collection the {@code Collection} to copy
                  (potentially {@code null} or empty)
@return the resulting {@code String} array
analyzer/src/main/java/nl/basjes/parse/useragent/utils/springframework/util/StringUtils.java