private static <T> Collection<T> makeCollectionOf(final T elem) {
        if (elem != null) {
            val list = new ArrayList<T>(1);
            list.add(elem);
            return list;
        }
        return new ArrayList<>();
    }
Helper method with reusable code.

@param <T>  the type param
@param elem the elem
@return collection
api/cas-server-core-api-util/src/main/java/org/apereo/cas/util/serialization/StringSerializer.java