@Test
public void testRepeatTake() {

    Observable<Integer> xs = Observable.from(1, 2);
    Object[] ys = xs.repeat(Schedulers.newThread()).take(4).toList().toBlockingObservable().last().toArray();
    assertArrayEquals(new Object[] { 1, 2, 1, 2 }, ys);
}