protected void set(int n, LabeledItem item) {
    LabeledItem old = (LabeledItem) getOrNull0(n);

    set0(n, item);

    if (old != null) {
      removeLabel(old.getLabel());
    }

    if (item != null) {
      addLabelIndex(item.getLabel(), n);
    }
  }
Sets the element at the given index.

@param n {@code >= 0, < size();} which element
@param item {@code null-ok;} the value to store
android/android_framework/dex-maker/src/main/java/com/android/dx/util/LabeledList.java