code: public static <T> Set<List<T>> permutations(Iterable<T> self) {
          Set<List<T>> ans = new HashSet<List<T>>();
          PermutationGenerator<T> generator = new PermutationGenerator<T>(self);
          while (generator.hasNext()) {
              ans.add(generator.next());
          }
          return ans;
      }
docs: Finds all permutations of an iterable.
  <p>
  Example usage:
  <pre class="groovyTestCase">def result = [1, 2, 3].permutations()
  assert result == [[3, 2, 1], [3, 1, 2], [1, 3, 2], [2, 3, 1], [2, 1, 3], [1, 2, 3]] as Set</pre>
  
  @param self the Iterable of items
  @return the permutations from the list
  @since 1.7.0