public void testAsyncCASResponse() throws InterruptedException,
    ExecutionException {
    String key = "testAsyncCASResponse";
    client.set(key, 300, key + "0");
    CASValue<Object> getsRes = client.gets(key);
    OperationFuture<CASResponse> casRes = client.asyncCAS(key, getsRes.getCas(),
      key + "1");
    try {
      casRes.getCas();
      fail("Expected an UnsupportedOperationException");
    } catch (UnsupportedOperationException ex) {
      //expected
    }
  }
This test assumes a server is running on the host specified in the
environment variable SPY_MC_TEST_SERVER or localhost:11211 by default.
src/test/java/net/spy/memcached/AsciiClientTest.java