@Test public void testElementAtWithIndexOutOfBounds() throws InterruptedException, ExecutionException { Observable<Integer> w = Observable.from(1, 2); Observable<Integer> observable = Observable.create(elementAt(w, 2)); try { Iterator<Integer> iter = OperationToIterator .toIterator(observable); assertTrue(iter.hasNext()); iter.next(); fail("expect an IndexOutOfBoundsException when index is out of bounds"); } catch (IndexOutOfBoundsException e) { } }
public static <T> OnSubscribeFunc<T> elementAt(Observable<? extends T> source, int index) { return new ElementAt<T>(source, index, null, false); }
OperationElementAt { public static <T> OnSubscribeFunc<T> elementAt(Observable<? extends T> source, int index) { return new ElementAt<T>(source, index, null, false); } }
OperationElementAt { public static <T> OnSubscribeFunc<T> elementAt(Observable<? extends T> source, int index) { return new ElementAt<T>(source, index, null, false); }  }
OperationElementAt { public static <T> OnSubscribeFunc<T> elementAt(Observable<? extends T> source, int index) { return new ElementAt<T>(source, index, null, false); }  static OnSubscribeFunc<T> elementAt(Observable<? extends T> source, int index); static OnSubscribeFunc<T> elementAtOrDefault(Observable<? extends T> source, int index, T defaultValue); }
OperationElementAt { public static <T> OnSubscribeFunc<T> elementAt(Observable<? extends T> source, int index) { return new ElementAt<T>(source, index, null, false); }  static OnSubscribeFunc<T> elementAt(Observable<? extends T> source, int index); static OnSubscribeFunc<T> elementAtOrDefault(Observable<? extends T> source, int index, T defaultValue);  }