Code example for HashSet

Methods: add

0
        jedis.sadd("foo", "a"); 
        jedis.sadd("foo", "b"); 
 
        long status = jedis.srem("foo", "a");
 
        Set<String> expected = new HashSet<String>();
        expected.add("b");
 
        assertEquals(1, status);
        assertEquals(expected, jedis.smembers("foo"));
 
        status = jedis.srem("foo", "bar");
 
        assertEquals(0, status);
 
        // Binary 
 
        jedis.sadd(bfoo, ba);
        jedis.sadd(bfoo, bb);
 
        long bstatus = jedis.srem(bfoo, ba);