code: public static <T> Set<T> toSet(Iterable<T> self) {
          return toSet(self.iterator());
      }
docs: Convert an Iterable to a Set. Always returns a new Set
  even if the Iterable is already a Set.
  <p>
  Example usage:
  <pre class="groovyTestCase">
  def result = [1, 2, 2, 2, 3].toSet()
  assert result instanceof Set
  assert result == [1, 2, 3] as Set
  </pre>
  
  @param self an Iterable
  @return a Set
  @since 2.4.0