private void doIncrementOrOverwrite(
     final BoundZSetOperations<String, Object> ops,
     Object object,
     Double score,
     boolean increment) {
   if (increment) {
     ops.incrementScore(object, score);
   } else {
     ops.add(object, score);
   }
 }
 public E last() {
   Set<E> members = boundZSetOps.reverseRange(0, 0);
   checkResult(members);
   Iterator<E> iterator = members.iterator();
   if (iterator.hasNext()) return iterator.next();
   throw new NoSuchElementException();
 }
 public Long reverseRank(Object o) {
   return boundZSetOps.reverseRank(o);
 }
 public Long rank(Object o) {
   return boundZSetOps.rank(o);
 }
 public int size() {
   Long result = boundZSetOps.size();
   checkResult(result);
   return result.intValue();
 }
 public boolean remove(Object o) {
   Long result = boundZSetOps.remove(o);
   checkResult(result);
   return result == 1;
 }
 public Set<E> reverseRange(long start, long end) {
   return boundZSetOps.reverseRange(start, end);
 }
 public RedisZSet<E> intersectAndStore(RedisZSet<?> set, String destKey) {
   boundZSetOps.intersectAndStore(set.getKey(), destKey);
   return new DefaultRedisZSet<E>(
       boundZSetOps.getOperations().boundZSetOps(destKey), getDefaultScore());
 }
 public void clear() {
   boundZSetOps.removeRange(0, -1);
 }
 public boolean add(E e, double score) {
   Boolean result = boundZSetOps.add(e, score);
   checkResult(result);
   return result;
 }
 public RedisZSet<E> removeByScore(double min, double max) {
   boundZSetOps.removeRangeByScore(min, max);
   return this;
 }
 public RedisZSet<E> remove(long start, long end) {
   boundZSetOps.removeRange(start, end);
   return this;
 }
 public Set<TypedTuple<E>> reverseRangeWithScores(long start, long end) {
   return boundZSetOps.reverseRangeWithScores(start, end);
 }
 public Set<TypedTuple<E>> reverseRangeByScoreWithScores(double min, double max) {
   return boundZSetOps.reverseRangeByScoreWithScores(min, max);
 }
 public Set<E> reverseRangeByScore(double min, double max) {
   return boundZSetOps.reverseRangeByScore(min, max);
 }
 public Double score(Object o) {
   return boundZSetOps.score(o);
 }
 /**
  * Constructs a new <code>DefaultRedisZSet</code> instance.
  *
  * @param boundOps
  * @param defaultScore
  */
 public DefaultRedisZSet(BoundZSetOperations<String, E> boundOps, double defaultScore) {
   super(boundOps.getKey(), boundOps.getOperations());
   this.boundZSetOps = boundOps;
   this.defaultScore = defaultScore;
 }
 public boolean contains(Object o) {
   return (boundZSetOps.rank(o) != null);
 }
 public RedisZSet<E> intersectAndStore(Collection<? extends RedisZSet<?>> sets, String destKey) {
   boundZSetOps.intersectAndStore(CollectionUtils.extractKeys(sets), destKey);
   return new DefaultRedisZSet<E>(
       boundZSetOps.getOperations().boundZSetOps(destKey), getDefaultScore());
 }
 public Iterator<E> iterator() {
   Set<E> members = boundZSetOps.range(0, -1);
   checkResult(members);
   return new DefaultRedisSortedSetIterator(members.iterator());
 }