@SuppressWarnings({"unchecked"})
public final E getAndSet (int i, E newValue)

Atomically sets the element at index i to newValue and returns the old value, with memory effects as specified by VarHandle.getAndSet.

Parameters:
i    the index
newValue    the new value

Returns:  the previous value