code: public static <T> T[] swap(T[] self, int i, int j) {
          T tmp = self[i];
          self[i] = self[j];
          self[j] = tmp;
          return self;
      }
docs: Swaps two elements at the specified positions.
  <p>
  Example:
  <pre class="groovyTestCase">
  assert (["a", "c", "b", "d"] as String[]) == (["a", "b", "c", "d"] as String[]).swap(1, 2)
  </pre>
  
  @param self an array
  @param i a position
  @param j a position
  @return self
  @since 2.4.0