public static < T > Set < T > toSet ( Iterable < T > iterable ) { Objects . requireNonNull ( iterable , "The iterable is null" ) ; return Iterables . toCollection ( iterable , new LinkedHashSet < T > ( ) ) ; }
Drains all elements that are provided by the iterator of the given iterable into a set