code: public E set(int index, E element) {
          checkElementIndex(index);
          Node<E> x = node(index);
          E oldVal = x.item;
          x.item = element;
          return oldVal;
      }
docs: Replaces the element at the specified position in this list with the
  specified element.
  
  @param index index of the element to replace
  @param element element to be stored at the specified position
  @return the element previously at the specified position
  @throws IndexOutOfBoundsException {@inheritDoc}