code: public static <K, T> Map<K, List<T>> groupBy(T[] self, @ClosureParams(FirstParam.Component.class) Closure<K> closure) {
          return groupBy((Iterable<T>)Arrays.asList(self), closure);
      }
docs: Sorts all array members into groups determined by the supplied mapping closure.
  The closure should return the key that this item should be grouped by. The returned
  LinkedHashMap will have an entry for each distinct key returned from the closure,
  with each value being a list of items for that group.
  <p>
  Example usage:
  <pre class="groovyTestCase">
  Integer[] items = [1,2,3,4,5,6]
  assert [0:[2,4,6], 1:[1,3,5]] == items.groupBy { it % 2 }
  </pre>
  
  @param self    an array to group
  @param closure a closure mapping entries on keys
  @return a new Map grouped by keys
  @see #groupBy(Iterable, Closure)
  @since 2.2.0