@Override
    public int drainTo(Collection<? super V> c) {
        return get(drainToAsync(c));
    }
@Test
    public void testDrainTo() {
        RBoundedBlockingQueue<Integer> queue = redisson.getBoundedBlockingQueue("queue");
        queue.trySetCapacity(100);
        for (int i = 0 ; i < 100; i++) {
            assertThat(queue.offer(i)).isTrue();
        }
        Assertions.assertEquals(100, queue.size());
        Set<Integer> batch = new HashSet<Integer>();
        assertThat(queue.remainingCapacity()).isEqualTo(0);
        int count = queue.drainTo(batch, 10);
        assertThat(queue.remainingCapacity()).isEqualTo(10);
        Assertions.assertEquals(10, count);
        Assertions.assertEquals(10, batch.size());
        Assertions.assertEquals(90, queue.size());
        queue.drainTo(batch, 10);
        assertThat(queue.remainingCapacity()).isEqualTo(20);
        queue.drainTo(batch, 20);
        assertThat(queue.remainingCapacity()).isEqualTo(40);
        queue.drainTo(batch, 60);
        assertThat(queue.remainingCapacity()).isEqualTo(100);
        Assertions.assertEquals(0, queue.size());
    }