public void testDeleteWithCAS() throws Exception {
    final String key = "delete.with.cas";
    final long wrongCAS = 1234;

    OperationFuture<Boolean> setFuture = client.set(key, 0, "test");
    assertTrue(setFuture.get());

    assertFalse(client.delete(key, wrongCAS).get());
    assertTrue(client.delete(key, setFuture.getCas()).get());
    assertNull(client.get(key));
  }
This test assumes a binary server is running on the host specified int the
environment variable SPYMC_TEST_SERVER_V4 or localhost:11211 by default.
src/test/java/net/spy/memcached/BinaryClientTest.java