public void compareAndSet() throws Exception {
AtomicReference<String> reference = new AtomicReference();
reference.compareAndSet(null, "test");
assert reference.get().equals("test");
assert reference.compareAndSet("test", "update");
assert reference.get().equals("update");
assert !reference.compareAndSet("don't", "apply");
assert reference.get().equals("update");
}