class CollectionUtils {

    public static <I, M, E extends Exception> Set<M> transformSet(final Collection<I> values,
                                                                  final Function<I, M, E> mapper) throws E {
        Reject.ifNull(values, mapper);
        final Set<M> newSet = new HashSet<M>(values.size());

        for (I value : values) {
            newSet.add(mapper.apply(value));
        }

        return newSet;
    }

    private  CollectionUtils();

}