public static <K, V> Map<K, V> wrap(final Multimap<K, V> source) {
        if (source != null && !source.isEmpty()) {
            val inner = source.asMap();
            val map = new HashMap<>();
            inner.forEach((k, v) -> map.put(k, wrap(v)));
            return (Map) map;
        }
        return new HashMap<>();
    }
Wrap map.

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