code: public static <T> T[] sort(T[] self, boolean mutate) {
          T[] answer = mutate ? self : self.clone();
          Arrays.sort(answer, new NumberAwareComparator<T>());
          return answer;
      }
docs: Sorts the given array into sorted order.
  The array items are assumed to be comparable.
  If mutate is true, the array is sorted in place and returned. Otherwise, a new sorted
  array is returned and the original array remains unchanged.
  <pre class="groovyTestCase">
  def orig = ["hello","hi","Hey"] as String[]
  def sorted = orig.sort(false)
  assert orig == ["hello","hi","Hey"] as String[]
  assert sorted == ["Hey","hello","hi"] as String[]
  orig.sort(true)
  assert orig == ["Hey","hello","hi"] as String[]
  </pre>
  
  @param self   the array to be sorted
  @param mutate false will always cause a new array to be created, true will mutate the array in place
  @return the sorted array
  @since 1.8.1