compareAndSet method
Atomically sets the value to the given newValue
if the current value equals the expectedValue,
returns true if the operation was successful and false only
if the current value was not equal to the expectedValue.
Implementation
external Boolean compareAndSet(T expectedValue, T newValue);