private void unionAnnotationSetsAndDirectories() {
    for (int i = 0; i < dexes.length; i++) {
      transformAnnotationSets(dexes[i], indexMaps[i]);
    }
    for (int i = 0; i < dexes.length; i++) {
      transformAnnotationSetRefLists(dexes[i], indexMaps[i]);
    }
    for (int i = 0; i < dexes.length; i++) {
      transformAnnotationDirectories(dexes[i], indexMaps[i]);
    }
    for (int i = 0; i < dexes.length; i++) {
      transformStaticValues(dexes[i], indexMaps[i]);
    }
  }
Copy annotation sets from each input to the output.

<p>TODO: this may write multiple copies of the same annotation set. We should shrink the output
by merging rather than unioning
android/android_framework/dex-maker/src/main/java/com/android/dx/merge/DexMerger.java