@Override
  public E set(int index, E element) throws IndexOutOfBoundsException {
    E oldValue;
    Object[] elements;
    Object[] newElements;
    do {
      elements = get();
      oldValue = get(elements, index);

      if (oldValue == element) {
        // Not quite a no-op; ensures volatile write semantics
        newElements = elements;
      }
      else {
        newElements = createArraySet(elements, index, element);
      }
    } while(!replaceArray(elements, newElements));
    return oldValue;
  }
@Override
  public E set(int index, E element)