flatMapToSet

inline fun <T, R> Collection<T>.flatMapToSet(transform: (T) -> Iterable<R>): Set<R>

Similar to Iterable.flatMap except it maps to a Set which preserves the iteration order.