@Test public void testEmptySumDoubles() throws Throwable { Observable<Double> src = Observable.empty(); sumDoubles(src).subscribe(wd); verify(wd, times(1)).onNext(anyDouble()); verify(wd).onNext(0.0d); verify(wd, never()).onError(any(Throwable.class)); verify(wd, times(1)).onCompleted(); }
public static Observable<Double> sumDoubles(Observable<Double> source) { return source.reduce(0.0d, new Func2<Double, Double, Double>() { @Override public Double call(Double accu, Double next) { return accu + next; } }); }
OperationSum { public static Observable<Double> sumDoubles(Observable<Double> source) { return source.reduce(0.0d, new Func2<Double, Double, Double>() { @Override public Double call(Double accu, Double next) { return accu + next; } }); } }
OperationSum { public static Observable<Double> sumDoubles(Observable<Double> source) { return source.reduce(0.0d, new Func2<Double, Double, Double>() { @Override public Double call(Double accu, Double next) { return accu + next; } }); }  }
OperationSum { public static Observable<Double> sumDoubles(Observable<Double> source) { return source.reduce(0.0d, new Func2<Double, Double, Double>() { @Override public Double call(Double accu, Double next) { return accu + next; } }); }  static Observable<Integer> sum(Observable<Integer> source); static Observable<Long> sumLongs(Observable<Long> source); static Observable<Float> sumFloats(Observable<Float> source); static Observable<Double> sumDoubles(Observable<Double> source); }
OperationSum { public static Observable<Double> sumDoubles(Observable<Double> source) { return source.reduce(0.0d, new Func2<Double, Double, Double>() { @Override public Double call(Double accu, Double next) { return accu + next; } }); }  static Observable<Integer> sum(Observable<Integer> source); static Observable<Long> sumLongs(Observable<Long> source); static Observable<Float> sumFloats(Observable<Float> source); static Observable<Double> sumDoubles(Observable<Double> source);  }