code: public int set(int index, int element)
      {
          boundsCheck(index);
          int prev = array[index];
          array[index] = element;
          return prev;
      }
docs: Operates exactly as {@link #set(int, java.lang.Integer) }
  @param index the index to set
  @param element the value to set
  @return the previous value at the index