public static int compareContents(TypeList list1, TypeList list2) {
    int size1 = list1.size();
    int size2 = list2.size();
    int size = Math.min(size1, size2);

    for (int i = 0; i < size; i++) {
      int comparison = list1.getType(i).compareTo(list2.getType(i));
      if (comparison != 0) {
        return comparison;
      }
    }

    if (size1 == size2) {
      return 0;
    } else if (size1 < size2) {
      return -1;
    } else {
      return 1;
    }
  }
Compares the contents of the given two instances for ordering. This is a static method so as to
work on arbitrary {@link TypeList} instances.

@param list1 {@code non-null;} one list to compare
@param list2 {@code non-null;} another list to compare
@return the order of the two lists
android/android_framework/dex-maker/src/main/java/com/android/dx/rop/type/StdTypeList.java