@Test
public void testRepetition() {

    int NUM = 10;
    final AtomicInteger count = new AtomicInteger();
    int value = Observable.create(new OnSubscribeFunc<Integer>() {
        @Override
        public Subscription onSubscribe(Observer<? super Integer> o) {
            o.onNext(count.incrementAndGet());
            o.onCompleted();
            return Subscriptions.empty();
        }
    }).repeat(Schedulers.computation()).take(NUM).toBlockingObservable().last();
    assertEquals(NUM, value);
}