public static boolean equalContents(TypeList list1, TypeList list2) {
    int size = list1.size();

    if (list2.size() != size) {
      return false;
    }

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

    return true;
  }
Compares the contents of the given two instances for equality. 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 whether the two lists contain corresponding equal elements
android/android_framework/dex-maker/src/main/java/com/android/dx/rop/type/StdTypeList.java