private <T> RFuture<T> pollEntry(int from, int to, RedisCommand<?> command) {
        return commandExecutor.evalWriteAsync(getRawName(), codec, command,
                "local v = redis.call('zrange', KEYS[1], ARGV[1], ARGV[2], 'withscores'); "
                    + "if #v > 0 then "
                        + "redis.call('zremrangebyrank', KEYS[1], ARGV[1], ARGV[2]); "
                        + "return v; "
                    + "end "
                    + "return v;",
                Collections.singletonList(getRawName()), from, to);
    }
@Test
    public void testPollEntry() {
        RScoredSortedSet<String> set = redisson.getScoredSortedSet("test");
        set.add(1.1, "v1");
        set.add(1.2, "v2");
        set.add(1.3, "v3");

        ScoredEntry<String> e = set.pollFirstEntry();
        assertThat(e).isEqualTo(new ScoredEntry<>(1.1, "v1"));

        ScoredEntry<String> e2 = set.pollLastEntry();
        assertThat(e2).isEqualTo(new ScoredEntry<>(1.3, "v3"));

        assertThat(set.size()).isEqualTo(1);
    }