code: public static <A extends Comparable<A>, B extends Comparable<B>> Comparator<CmsPair<A, B>> getLexicalComparator() {
  
          return new Comparator<CmsPair<A, B>>() {
  
              /**
               * @see java.util.Comparator#compare(Object,Object)
               */
              public int compare(CmsPair<A, B> pair1, CmsPair<A, B> pair2) {
  
                  int c = pair1.getFirst().compareTo(pair2.getFirst());
                  if (c != 0) {
                      return c;
                  }
                  return pair1.getSecond().compareTo(pair2.getSecond());
              }
          };
      }
docs: Utility method which creates a new comparator for lexically ordering pairs.<p>
  
  Lexical ordering means that a pair is considered "less" than another if either its
  first component is less than that of the other one, or their first components are equal
  and the second component of the first pair is less than that of the other one.<p>
  
  @param <A> the type parameter for the first pair component
  @param <B> the type parameter for the second pair component
  
  @return a new comparator for lexically ordering pairs