jedis.zadd("foo", 1, "a");
jedis.zadd("foo", 2, "b");
jedis.zadd("bar", 2, "a");
jedis.zadd("bar", 2, "b");
ZParams params = new ZParams();
params.weights(2, 2.5);
params.aggregate(ZParams.Aggregate.SUM);
long result = jedis.zunionstore("dst", params, "foo", "bar");
assertEquals(2, result);
Set<Tuple> expected = new LinkedHashSet<Tuple>();
expected.add(new Tuple("b", new Double(9)));
expected.add(new Tuple("a", new Double(7)));
assertEquals(expected, jedis.zrangeWithScores("dst", 0, 100));
// Binary
jedis.zadd(bfoo, 1, ba);
jedis.zadd(bfoo, 2, bb);
jedis.zadd(bbar, 2, ba);
jedis.zadd(bbar, 2, bb);
ZParams bparams = new ZParams();
bparams.weights(2, 2.5);
bparams.aggregate(ZParams.Aggregate.SUM);
long bresult = jedis.zunionstore(SafeEncoder.encode("dst"), bparams,
bfoo, bbar);
assertEquals(2, bresult);