A synchronized view of a MutableSortedBag. It is imperative that the user manually synchronize on the collection when iterating over it using the
standard JDK iterator or JDK 5 for loop, as per Collections.synchronizedCollection(Collection).

For each element of the iterable, the function is evaluated and the results of these evaluations are collected
into a new multimap, where the transformed value is the key and the original values are added to the same (or similar)
species of collection as the source iterable.

of

with

This method allows mutable and fixed size collections the ability to add elements to their existing elements.
In order to support fixed size a new instance of a collection would have to be returned taking the elements of
the original collection and appending the new element to form the new collection. In the case of mutable
collections, the original collection is modified, and is returned. In order to use this method properly with
mutable and fixed size collections the following approach must be taken:

In the case of FixedSizeCollection a new instance of MutableCollection will be returned by with, and any
variables that previously referenced the original collection will need to be redirected to reference the
new instance. For other MutableCollection types you will replace the reference to collection with the same
collection, since the instance will return "this" after calling add on itself.

without

This method allows mutable and fixed size collections the ability to remove elements from their existing elements.
In order to support fixed size a new instance of a collection would have to be returned containing the elements
that would be left from the original collection after calling remove. In the case of mutable collections, the
original collection is modified, and is returned. In order to use this method properly with mutable and fixed
size collections the following approach must be taken:

In the case of FixedSizeCollection a new instance of MutableCollection will be returned by without, and
any variables that previously referenced the original collection will need to be redirected to reference the
new instance. For other MutableCollection types you will replace the reference to collection with the same
collection, since the instance will return "this" after calling remove on itself.

withAll

This method allows mutable and fixed size collections the ability to add multiple elements to their existing
elements. In order to support fixed size a new instance of a collection would have to be returned taking the
elements of the original collection and appending the new elements to form the new collection. In the case of
mutable collections, the original collection is modified, and is returned. In order to use this method properly
with mutable and fixed size collections the following approach must be taken:

In the case of FixedSizeCollection a new instance of MutableCollection will be returned by withAll, and
any variables that previously referenced the original collection will need to be redirected to reference the
new instance. For other MutableCollection types you will replace the reference to collection with the same
collection, since the instance will return "this" after calling addAll on itself.

withoutAll

This method allows mutable and fixed size collections the ability to remove multiple elements from their existing
elements. In order to support fixed size a new instance of a collection would have to be returned containing the
elements that would be left from the original collection after calling removeAll. In the case of mutable
collections, the original collection is modified, and is returned. In order to use this method properly with
mutable and fixed size collections the following approach must be taken:

In the case of FixedSizeCollection a new instance of MutableCollection will be returned by withoutAll,
and any variables that previously referenced the original collection will need to be redirected to reference the
new instance. For other MutableCollection types you will replace the reference to collection with the same
collection, since the instance will return "this" after calling removeAll on itself.

newEmpty

Creates a new empty mutable version of the same collection type. For example, if this instance is a FastList,
this method will return a new empty FastList. If the class of this instance is immutable or fixed size (i.e.
SingletonList) then a mutable alternative to the class will be provided.

corresponds

Returns true if both OrderedIterables have the same length
and predicate returns true for all corresponding elements e1 of
this OrderedIterable and e2 of other.
The predicate is evaluated for each element at the same position of each OrderedIterable in a forward iteration order.
This is a short circuit pattern.

reject

Returns all elements of the source collection that return false when evaluating of the predicate. This method is also
sometimes called filterNot and is the equivalent of calling iterable.select(Predicates.not(predicate)).

collectIf

Returns a new collection with the results of applying the specified function on each element of the source
collection, but only for those elements which return true upon evaluation of the predicate. This is the
the optimized equivalent of calling iterable.select(predicate).collect(function).

flatCollect

flatCollect is a special case of RichIterable.collect(Function). With collect, when the Function returns
a collection, the result is a collection of collections. flatCollect outputs a single "flattened" collection
instead. This method is commonly called flatMap.

Consider the following example where we have a Person class, and each Person has a list of Address objects. Take the following Function:

groupBy

For each element of the iterable, the function is evaluated and the results of these evaluations are collected
into a new multimap, where the transformed value is the key and the original values are added to the same (or similar)
species of collection as the source iterable.

zip

Returns a RichIterable formed from this RichIterable and another RichIterable by
combining corresponding elements in pairs. If one of the two RichIterables is longer than the other, its
remaining elements are ignored.

A new RichIterable containing pairs consisting of corresponding elements of this
RichIterable and that. The length of the returned RichIterable is the minimum of the lengths of
this RichIterable and that.

asSynchronized

Returns a synchronized wrapper backed by this collection. This is the equivalent of using
Collections.synchronizedCollection(this) only with a return type that supports the full
iteration protocols available on MutableCollection.
The preferred way of iterating over a synchronized collection is to use the internal iteration
methods which are properly synchronized internally.

getFirstOptional

Returns the first element of an iterable as an Optional. In the case of a List it is the element at the first index.
In the case of any other Collection, it is the first element that would be returned during an iteration. If the
iterable is empty, Optional.empty() is returned.

getLastOptional

Returns the last element of an iterable as an Optional. In the case of a List it is the element at the last index.
In the case of any other Collection, it is the last element that would be returned during an iteration. If the
iterable is empty, Optional.empty() is returned.