@Override
      void updateIndex(int offset, IndexMap indexMap, int oldIndex, int newIndex) {
        if (newIndex < 0 || newIndex > 0xffff) {
          throw new DexIndexOverflowException("proto ID not in [0, 0xffff]: " + newIndex);
        }
        indexMap.protoIds[oldIndex] = (short) newIndex;
      }
minimum number of wasted bytes before it's worthwhile to compact the result
android/android_framework/dex-maker/src/main/java/com/android/dx/merge/DexMerger.java