public Flowable<V> takeFirstElements() {
        return ElementsStream.takeElements(queue::takeFirstAsync);
    }
@Test
    public void testTakeFirstElements() {
        RBlockingDequeRx<Integer> queue = redisson.getBlockingDeque("test");
        List<Integer> elements = new ArrayList<>();
        queue.takeFirstElements().subscribe(new Subscriber<Integer>() {

            @Override
            public void onSubscribe(Subscription s) {
                s.request(4);
            }

            @Override
            public void onNext(Integer t) {
                elements.add(t);
            }

            @Override
            public void onError(Throwable t) {
            }

            @Override
            public void onComplete() {
            }
        });
        
        for (int i = 0; i < 10; i++) {
            sync(queue.add(i));
        }
        
        assertThat(elements).containsExactly(0, 1, 2, 3);
    }