private void mergeClassDefs() {
    SortableType[] types = getSortedTypes();
    contentsOut.classDefs.off = idsDefsOut.getPosition();
    contentsOut.classDefs.size = types.length;

    for (SortableType type : types) {
      Dex in = type.getDex();
      transformClassDef(in, type.getClassDef(), type.getIndexMap());
    }
  }
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