to Array
Returns the underlying LongArray, truncating as necessary so that the returned array has the same size as the number of elements in it.
Because this method truncates the underlying array, it should only be called after all elements have been added to the list, otherwise the next call to add() will cause the array to be resized.