@Override
  public final int compareTo(Constant other) {
    Class clazz = getClass();
    Class otherClazz = other.getClass();

    if (clazz != otherClazz) {
      return clazz.getName().compareTo(otherClazz.getName());
    }

    return compareTo0(other);
  }
{@inheritDoc}

<p>This compares in class-major and value-minor order.
android/android_framework/dex-maker/src/main/java/com/android/dx/rop/cst/Constant.java