@Test public void testMaxByWithEmpty() { Observable<List<String>> observable = maxBy( Observable.<String> empty(), new Func1<String, Integer>() { @Override public Integer call(String t1) { return Integer.parseInt(t1) % 2; } }); @SuppressWarnings("unchecked") Observer<List<String>> observer = (Observer<List<String>>) mock(Observer.class); observable.subscribe(observer); InOrder inOrder = inOrder(observer); inOrder.verify(observer, times(1)).onNext(new ArrayList<String>()); inOrder.verify(observer, times(1)).onCompleted(); inOrder.verifyNoMoreInteractions(); }
public static <T, R extends Comparable<? super R>> Observable<List<T>> maxBy( Observable<T> source, final Func1<T, R> selector) { return minMaxBy(source, selector, 1L); }
OperationMinMax { public static <T, R extends Comparable<? super R>> Observable<List<T>> maxBy( Observable<T> source, final Func1<T, R> selector) { return minMaxBy(source, selector, 1L); } }
OperationMinMax { public static <T, R extends Comparable<? super R>> Observable<List<T>> maxBy( Observable<T> source, final Func1<T, R> selector) { return minMaxBy(source, selector, 1L); }  }
OperationMinMax { public static <T, R extends Comparable<? super R>> Observable<List<T>> maxBy( Observable<T> source, final Func1<T, R> selector) { return minMaxBy(source, selector, 1L); }  static Observable<T> min(
            Observable<T> source); static Observable<T> min(Observable<T> source,
            final Comparator<? super T> comparator); static Observable<List<T>> minBy(
            Observable<T> source, final Func1<T, R> selector); static Observable<List<T>> minBy(Observable<T> source,
            final Func1<T, R> selector, final Comparator<? super R> comparator); static Observable<T> max(
            Observable<T> source); static Observable<T> max(Observable<T> source,
            final Comparator<? super T> comparator); static Observable<List<T>> maxBy(
            Observable<T> source, final Func1<T, R> selector); static Observable<List<T>> maxBy(Observable<T> source,
            final Func1<T, R> selector, final Comparator<? super R> comparator); }
OperationMinMax { public static <T, R extends Comparable<? super R>> Observable<List<T>> maxBy( Observable<T> source, final Func1<T, R> selector) { return minMaxBy(source, selector, 1L); }  static Observable<T> min(
            Observable<T> source); static Observable<T> min(Observable<T> source,
            final Comparator<? super T> comparator); static Observable<List<T>> minBy(
            Observable<T> source, final Func1<T, R> selector); static Observable<List<T>> minBy(Observable<T> source,
            final Func1<T, R> selector, final Comparator<? super R> comparator); static Observable<T> max(
            Observable<T> source); static Observable<T> max(Observable<T> source,
            final Comparator<? super T> comparator); static Observable<List<T>> maxBy(
            Observable<T> source, final Func1<T, R> selector); static Observable<List<T>> maxBy(Observable<T> source,
            final Func1<T, R> selector, final Comparator<? super R> comparator);  }