private static <T> void addToCollection(final Collection<T> list, final T[] source) {
        if (source != null) {
            Arrays.stream(source).forEach(s -> {
                val col = toCollection(s);
                list.addAll((Collection) col);
            });
        }
    }
Wrap collection.

@param <T>    the type parameter
@param source the source
@return the collection
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/CollectionUtils.java