Code example for HashSet

Methods: add

0
    public void keys() { 
	jedis.set("foo", "bar"); 
	jedis.set("foobar", "bar"); 
 
	Set<String> keys = jedis.keys("foo*");
	Set<String> expected = new HashSet<String>();
	expected.add("foo");
	expected.add("foobar");
	assertEquals(expected, keys);
 
	expected = new HashSet<String>();
	keys = jedis.keys("bar*");
 
	assertEquals(expected, keys);
 
	// Binary 
	jedis.set(bfoo, bbar);
	jedis.set(bfoobar, bbar);
 
	Set<byte[]> bkeys = jedis.keys(bfoostar);
	assertEquals(2, bkeys.size());