code: public static <U extends Comparable<? super U>> int lexCompare(Iterable<? extends U> o1, Iterable<? extends U> o2) {
          Iterator<? extends U> it1 = o1.iterator(), it2 = o2.iterator();
  
          while (it1.hasNext() && it2.hasNext()) {
              int cmp = it1.next().compareTo(it2.next());
              if (cmp != 0) {
                  return cmp;
              }
          }
  
          if (it1.hasNext()) {
              return 1;
          } else if (it2.hasNext()) {
              return -1;
          }
          return 0;
      }
docs: Lexicographically compares two {@link Iterable}s, whose element types are comparable.