public static int compare(short ushortA, short ushortB) {
    if (ushortA == ushortB) {
      return 0;
    }
    int a = ushortA & 0xFFFF;
    int b = ushortB & 0xFFFF;
    return a < b ? -1 : 1;
  }
Unsigned arithmetic over Java's signed types.
android/android_framework/dex-maker/src/main/java/com/android/dex/util/Unsigned.java