assertEquals(7, result);
}
@Test
public void testCompareAndSet() throws Exception {
IAtomicLong atomicLong = getAtomicLong();
atomicLong.set(11);
final SimpleClient client = getClient();
client.send(new CompareAndSetRequest(name, 9, 5));
boolean result = (Boolean) client.receive();
assertFalse(result);
assertEquals(11, atomicLong.get());
client.send(new CompareAndSetRequest(name, 11, 5));
result = (Boolean) client.receive();
assertTrue(result);
assertEquals(5, atomicLong.get());
}