code: @SuppressWarnings("unchecked")
      public static <T> T[] toUnique(T[] self) {
          return (T[]) toUnique(self, (Comparator) null);
      }
docs: Returns a new Array containing the items from the original Array but with duplicates removed using the
  natural ordering of the items in the array.
  <p>
  <pre class="groovyTestCase">
  String[] letters = ['c', 'a', 't', 's', 'a', 't', 'h', 'a', 't']
  String[] expected = ['c', 'a', 't', 's', 'h']
  def result = letters.toUnique()
  assert result == expected
  assert result.class.componentType == String
  </pre>
  
  @param self an array
  @return the unique items from the array