class CollectionUtils {

    public static <K, I, M, E extends Exception> Map<K, M> transformMap(final Map<K, I> map,
                                                                        final Function<I, M, E> mapper) throws E {
        Reject.ifNull(map, mapper);
        final Map<K, M> newMap = new HashMap<K, M>(map.size());

        for (Map.Entry<K, I> entry : map.entrySet()) {
            newMap.put(entry.getKey(), mapper.apply(entry.getValue()));
        }

        return newMap;
    }

    private  CollectionUtils();

}