public void testReplace() throws TimeoutException, MemcachedException {
		String readObject = null;
		String key = null;
		String value = null;
		
		//1
        value = "ABCD";
		key = "testrep1";

		c.set(key, 3600, "World");

		boolean flag = c.replace(key, 3600, value);
		assertTrue(flag);
		readObject = (String) c.get(key);
		assertNotNull(readObject);
		assertEquals("ABCD", readObject);

		c.delete(key);
		
		flag = c.replace(key, 3600, "XYZ");
		assertFalse(flag);
		
		//read old value i.e. no value
		readObject = (String) c.get(key);
		assertNull(readObject);
		
		//2
		key = "testrep2";
		c.set(key, 3600, "World");
		
		Object client = c.getBaseClient();
		if(client instanceof net.rubyeye.xmemcached.MemcachedClient) {
			net.rubyeye.xmemcached.MemcachedClient xmc = (net.rubyeye.xmemcached.MemcachedClient) client;
			try {
				xmc.replaceWithNoReply(key, 3600, value);
			} catch (InterruptedException ex) {
				Logger.getLogger(ProtocolTest.class.getName()).log(Level.SEVERE, null, ex);
			} catch (net.rubyeye.xmemcached.exception.MemcachedException ex) {
				Logger.getLogger(ProtocolTest.class.getName()).log(Level.SEVERE, null, ex);
			}
			
			readObject = (String) c.get(key);
			assertNotNull(readObject);
			assertEquals("ABCD", readObject);
		} else if (client instanceof net.spy.memcached.MemcachedClient) {			
			//does not support noreply			
		}		
		
		c.delete(key);		
		if(client instanceof net.rubyeye.xmemcached.MemcachedClient) {
			net.rubyeye.xmemcached.MemcachedClient xmc = (net.rubyeye.xmemcached.MemcachedClient) client;
			try {
				xmc.replaceWithNoReply(key, 3600, "XYZ");
			} catch (InterruptedException ex) {
				Logger.getLogger(ProtocolTest.class.getName()).log(Level.SEVERE, null, ex);
			} catch (net.rubyeye.xmemcached.exception.MemcachedException ex) {
				Logger.getLogger(ProtocolTest.class.getName()).log(Level.SEVERE, null, ex);
			} 
			
			//read old value i.e. no value
			readObject = (String) c.get(key);
			assertNull(readObject);	
		} else if (client instanceof net.spy.memcached.MemcachedClient) {			
			//does not support noreply			
		}			
	}