code: @Deprecated
      public static <T extends Comparable<T>> int compare(Iterator<T> first, Iterator<T> other) {
          while (true) {
              if (!first.hasNext()) {
                  return other.hasNext() ? -1 : 0;
              } else if (!other.hasNext()) {
                  return 1;
              }
              T item1 = first.next();
              T item2 = other.next();
              int result = item1.compareTo(item2);
              if (result != 0) {
                  return result;
              }
          }
      }
docs: Utility to compare two iterators. Warning: the ordering in iterables is important. For Collections that are ordered,
  like Lists, that is expected. However, Sets in Java violate Leibniz's law when it comes to iteration.
  That means that sets can't be compared directly with this method, unless they are TreeSets without
  (or with the same) comparator. Unfortunately, it is impossible to reliably detect in Java whether subclass of
  Collection satisfies the right criteria, so it is left to the user to avoid those circumstances.
  @deprecated This API is ICU internal only.
  @hide original deprecated declaration
  @hide draft / provisional / internal are hidden on Android