class CollectionUtil {

  public static <K1, K2, V> Map<K2, V> toMap(
      Set<K1> set, Function<K1, K2> keyFunction, Function<K1, V> valueFunction) {
    return set.stream().collect(Collectors.toMap(keyFunction, valueFunction));
  }

  private  CollectionUtil();

}