public void add(Annotation annotation) {
    throwIfImmutable();

    if (annotation == null) {
      throw new NullPointerException("annotation == null");
    }

    CstType type = annotation.getType();

    if (annotations.containsKey(type)) {
      throw new IllegalArgumentException("duplicate type: " + type.toHuman());
    }

    annotations.put(type, annotation);
  }
Adds an element to this instance. There must not already be an element of the same type.

@param annotation {@code non-null;} the element to add
@throws IllegalArgumentException thrown if there is a duplicate type
android/android_framework/dex-maker/src/main/java/com/android/dx/rop/annotation/Annotations.java