addAll

Inserts all of the elements in the specified collection into me,
at the specified position (optional operation). Shifts the
element currently at that position (if any) and any subsequent
elements to the right, increasing their indices. The new elements
will appear in the order that they are returned by the given
collection's iterator.

subList

Returns a view of the elements within me
between the specified fromIndex, inclusive, and
toIndex, exclusive. The returned LongList
is backed by me, so that any changes in
the returned list are reflected in me, and vice-versa.
The returned list supports all of the optional operations
that I support.

Note that when fromIndex == toIndex,
the returned list is initially empty, and when
fromIndex == 0 && toIndex == size()
the returned list is my "improper" sublist, containing all my elements.

The semantics of the returned list become undefined
if I am structurally modified in any way other than
via the returned list.

equals

Returns true iff that is an LongList
that contains the same elements in the same order as me.
In other words, returns true iff that is
a LongList that has the same size as me,
and for which the elements returned by its
iterator are equal (==) to
the corresponding elements within me.
(This contract ensures that this method works properly across
different implementations of the LongList interface.)

getCollection

add

Ensures that I contain the specified element
(optional operation). Returns true
iff I changed as a result of this call.

If a collection refuses to add the specified
element for any reason other than that it already contains
the element, it must throw an exception (rather than
simply returning false). This preserves the invariant
that a collection always contains the specified element after
this call returns.

removeAll

Removes all of my elements that are contained in the
specified collection (optional operation).
The behavior of this method is unspecified if
the given collection is modified while this method
is executing. Note that this includes the case
in which the given collection is this collection,
and it is not empty.

retainAll

Removes all of my elements that are not contained in the
specified collection (optional operation).
(In other words, retains only my elements that are
contained in the specified collection.)
The behavior of this method is unspecified if
the given collection is modified while this method
is executing.

toArray

Returns an array containing all of my elements,
using the given array if it is large
enough. When the length of the given array is
larger than the number of elements I contain,
values outside of my range will be unchanged.

The returned array will be independent of me,
so that callers may modify that
returned array without modifying this collection.

When I guarantee the order in which
elements are returned by an iterator,
the returned array will contain elements in the
same order.