code: public short[] toShortArray() {
      short[] copy = new short[size];
      for (int i = 0; i < size; i++) {
        copy[i] = elements[i];
      }
      return copy;
    }
docs: Converts this <code>ShortArray</code> to an array of shorts.
  
  @return An array of shorts containing the same elements as this array.