public static int hashContents(TypeList list) {
    int size = list.size();
    int hash = 0;

    for (int i = 0; i < size; i++) {
      hash = (hash * 31) + list.getType(i).hashCode();
    }

    return hash;
  }
Returns a hashcode of the contents of the given list. This is a static method so as to work on
arbitrary {@link TypeList} instances.

@param list {@code non-null;} the list to inspect
@return {@code non-null;} the hash code
android/android_framework/dex-maker/src/main/java/com/android/dx/rop/type/StdTypeList.java