Returns the elements of unfiltered that satisfy a predicate. The
returned collection is a live view of unfiltered; changes to one
affect the other.

The resulting collection's iterator does not support remove(),
but all other collection methods are supported. When given an element that
doesn't satisfy the predicate, the collection's add() and addAll() methods throw an IllegalArgumentException. When methods
such as removeAll() and clear() are called on the filtered
collection, only elements that satisfy the filter will be removed from the
underlying collection.

The returned collection isn't threadsafe or serializable, even if
unfiltered is.

Many of the filtered collection's methods, such as size(),
iterate across every element in the underlying collection and determine
which elements satisfy the filter. When a live view is not needed,
it may be faster to copy Iterables.filter(unfiltered, predicate)
and use the copy.

Warning:predicate must be consistent with equals,
as documented at Predicate.apply. Do not provide a predicate such
as Predicates.instanceOf(ArrayList.class), which is inconsistent
with equals. (See Iterables.filter(Iterable, Class) for related
functionality.)

Returns true if the collection self contains all of the
elements in the collection c.

This method iterates over the specified collection c, checking
each element returned by the iterator in turn to see if it is contained in
the specified collection self. If all elements are so contained,
true is returned, otherwise false.

Returns a Collection of all the permutations of the specified
Iterable.

Notes: This is an implementation of the algorithm for
Lexicographical Permutations Generation, described in Knuth's "The Art of
Computer Programming", Volume 4, Chapter 7, Section 7.2.1.2. The
iteration order follows the lexicographical order. This means that
the first permutation will be in ascending order, and the last will be in
descending order.

Duplicate elements are considered equal. For example, the list [1, 1]
will have only one permutation, instead of two. This is why the elements
have to implement Comparable.

An empty iterable has only one permutation, which is an empty list.

This method is equivalent to
Collections2.orderedPermutations(list, Ordering.natural()).

Parameters:

elements the original iterable whose elements have to be permuted.

Returns:

an immutable Collection containing all the different
permutations of the original iterable.

Throws:

NullPointerException if the specified iterable is null or has any
null elements.

Notes: This is an implementation of the algorithm for
Lexicographical Permutations Generation, described in Knuth's "The Art of
Computer Programming", Volume 4, Chapter 7, Section 7.2.1.2. The
iteration order follows the lexicographical order. This means that
the first permutation will be in ascending order, and the last will be in
descending order.

Elements that compare equal are considered equal and no new permutations
are created by swapping them.

An empty iterable has only one permutation, which is an empty list.

Parameters:

elements the original iterable whose elements have to be permuted.

comparator a comparator for the iterable's elements.

Returns:

an immutable Collection containing all the different
permutations of the original iterable.

Throws:

NullPointerException If the specified iterable is null, has any
null elements, or if the specified comparator is null.