code: @SuppressWarnings("unchecked")
      public static <T> T[] toUnique(T[] self, @ClosureParams(value=FromString.class, options={"T","T,T"}) Closure condition) {
          Comparator<T> comparator = condition.getMaximumNumberOfParameters() == 1
                  ? new OrderBy<T>(condition, true)
                  : new ClosureComparator<T>(condition);
          return toUnique(self, comparator);
      }
docs: Returns a new Array containing the items from the original Array but with duplicates removed with the supplied
  comparator determining which items are unique.
  <p>
  <pre class="groovyTestCase">
  String[] letters = ['c', 'a', 't', 's', 'A', 't', 'h', 'a', 'T']
  String[] expected = ['c', 'a', 't', 's', 'h']
  assert letters.toUnique{ p1, p2 {@code ->} p1.toLowerCase() {@code <=>} p2.toLowerCase() } == expected
  assert letters.toUnique{ it.toLowerCase() } == expected
  </pre>
  
  @param self an array
  @param condition a Closure used to determine unique items
  @return the unique items from the array