public static Map<String, List<Object>> toMultiValuedMap(final Map<String, Object> attributes) {
        val entries = attributes.entrySet();
        return entries
            .stream()
            .collect(Collectors.toMap(Map.Entry::getKey, entry -> {
                val value = entry.getValue();
                return toCollection(value, ArrayList.class);
            }));
    }
Convert attribute values to multi valued objects.

@param attributes the attributes
@return the map of attributes to return
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/CollectionUtils.java