public void set(int n, int value) {
    throwIfImmutable();

    if (n >= size) {
      throw new IndexOutOfBoundsException("n >= size()");
    }

    try {
      values[n] = value;
      sorted = false;
    } catch (ArrayIndexOutOfBoundsException ex) {
      // Translate the exception.
      if (n < 0) {
        throw new IllegalArgumentException("n < 0");
      }
    }
  }
Sets the value at the given index.

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