android/guava/src/com/google/common/collect/Ordering.java
@GwtCompatible(serializable = true)
  // type parameter <S> lets us avoid the extra <String> in statements like:
  // Ordering<Iterable<String>> o =
  //     Ordering.<String>natural().lexicographical();
  public <S extends T> Ordering<Iterable<S>> lexicographical() {
    /*
     * Note that technically the returned ordering should be capable of
     * handling not just {@code Iterable<S>} instances, but also any {@code
     * Iterable<? extends S>}. However, the need for this comes up so rarely
     * that it doesn't justify making everyone else deal with the very ugly
     * wildcard.
     */
    return new LexicographicalOrdering<S>(this);
  }
@GwtCompatible(serializable = true)
  // type parameter <S> lets us avoid the extra <String> in statements like:
  // Ordering<Iterable<String>> o =
  //     Ordering.<String>natural().lexicographical();
  public <S extends T> Ordering<Iterable<S>> lexicographical() {
    /*
     * Note that technically the returned ordering should be capable of
     * handling not just {@code Iterable<S>} instances, but also any {@code
     * Iterable<? extends S>}. However, the need for this comes up so rarely
     * that it doesn't justify making everyone else deal with the very ugly
     * wildcard.
     */
    return new LexicographicalOrdering<S>(this);
  }
@ GwtCompatible ( serializable = true ) // type parameter <S> lets us avoid the extra <String> in statements like: // Ordering<Iterable<String>> o = //     Ordering.<String>natural().lexicographical(); public < S extends T > Ordering < Iterable < S > > lexicographical ( ) { /*
     * Note that technically the returned ordering should be capable of
     * handling not just {@code Iterable<S>} instances, but also any {@code
     * Iterable<? extends S>}. However, the need for this comes up so rarely
     * that it doesn't justify making everyone else deal with the very ugly
     * wildcard.
     */ return new LexicographicalOrdering < S > ( this ) ; }
Returns a new ordering which sorts iterables by comparing corresponding elements pairwise until
a nonzero result is found; imposes "dictionary order". If the end of one iterable is reached,
but not the other, the shorter iterable is considered to be less than the longer one. For
example, a lexicographical natural ordering over integers considers {@code [] < [1] < [1, 1] <
[1, 2] < [2]}.

<p>Note that {@code ordering.lexicographical().reverse()} is not equivalent to {@code
ordering.reverse().lexicographical()} (consider how each would order {@code [1]} and {@code [1,
1]}).

<p><b>Java 8 users:</b> Use {@link Comparators#lexicographical(Comparator)} instead.

@since 2.0
Returns a new ordering which sorts iterables by comparing corresponding elements pairwise until a nonzero result is found ; imposes dictionary order . If the end of one iterable is reached but not the other the shorter iterable is considered to be less than the longer one . For example a lexicographical natural ordering over integers considers { @code [] < [ 1 ] < [ 1 1 ] < [ 1 2 ] < [ 2 ] } .