@Test public void testElementAtOrDefaultWithMinusIndex() { Observable<Integer> w = Observable.from(1, 2); Observable<Integer> observable = Observable .create(elementAtOrDefault(w, -1, 0)); 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> elementAtOrDefault(Observable<? extends T> source, int index, T defaultValue) { return new ElementAt<T>(source, index, defaultValue, true); }
OperationElementAt { public static <T> OnSubscribeFunc<T> elementAtOrDefault(Observable<? extends T> source, int index, T defaultValue) { return new ElementAt<T>(source, index, defaultValue, true); } }
OperationElementAt { public static <T> OnSubscribeFunc<T> elementAtOrDefault(Observable<? extends T> source, int index, T defaultValue) { return new ElementAt<T>(source, index, defaultValue, true); }  }
OperationElementAt { public static <T> OnSubscribeFunc<T> elementAtOrDefault(Observable<? extends T> source, int index, T defaultValue) { return new ElementAt<T>(source, index, defaultValue, true); }  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> elementAtOrDefault(Observable<? extends T> source, int index, T defaultValue) { return new ElementAt<T>(source, index, defaultValue, true); }  static OnSubscribeFunc<T> elementAt(Observable<? extends T> source, int index); static OnSubscribeFunc<T> elementAtOrDefault(Observable<? extends T> source, int index, T defaultValue);  }