public void add(ClassDefItem clazz) {
    Type type;

    try {
      type = clazz.getThisClass().getClassType();
    } catch (NullPointerException ex) {
      // Elucidate the exception.
      throw new NullPointerException("clazz == null");
    }

    throwIfPrepared();

    if (classDefs.get(type) != null) {
      throw new IllegalArgumentException("already added: " + type);
    }

    classDefs.put(type, clazz);
  }
Adds an element to this instance. It is illegal to attempt to add more than one class with the
same name.

@param clazz {@code non-null;} the class def to add
android/android_framework/dex-maker/src/main/java/com/android/dx/dex/file/ClassDefsSection.java