public static AnnotationsList combine(AnnotationsList list1, AnnotationsList list2) {
    int size = list1.size();

    if (size != list2.size()) {
      throw new IllegalArgumentException("list1.size() != list2.size()");
    }

    AnnotationsList result = new AnnotationsList(size);

    for (int i = 0; i < size; i++) {
      Annotations a1 = list1.get(i);
      Annotations a2 = list2.get(i);
      result.set(i, Annotations.combine(a1, a2));
    }

    result.setImmutable();
    return result;
  }
Constructs an immutable instance which is the combination of the two given instances. The two
instances must each have the same number of elements, and each pair of elements must contain
disjoint sets of types.

@param list1 {@code non-null;} an instance
@param list2 {@code non-null;} the other instance
@return {@code non-null;} the combination
android/android_framework/dex-maker/src/main/java/com/android/dx/rop/annotation/AnnotationsList.java