@Override
  public final boolean equals(Object other) {
    if (this == other) {
      return true;
    }

    OffsettedItem otherItem = (OffsettedItem) other;
    ItemType thisType = itemType();
    ItemType otherType = otherItem.itemType();

    if (thisType != otherType) {
      return false;
    }

    return (compareTo0(otherItem) == 0);
  }
{@inheritDoc}

<p>Comparisons for this class are defined to be type-major (if the types don't match then the
objects are not equal), with {@link #compareTo0} deciding same-type comparisons.
android/android_framework/dex-maker/src/main/java/com/android/dx/dex/file/OffsettedItem.java