Finding the mean using RxJava
Using RxJava-Math you can achieve the same result by this way:

List&lt;Transaction&gt; transactions = createRandomTransactions(10);

final Observable&lt;Float&gt; amountStream = Observable.from(transactions)
        .map(transaction -&gt; transaction.amount);

MathObservable.averageFloat(amountStream)
        .map(mean -&gt; String.format(Locale.US, "The mean is %.2f", mean))
        .subscribe(System.out::println);


Hope that helps!