I'm learning RxJava and this is what I attempted to find the mean of 'n' transactions.List<Transaction> transactions = TransactionsStore.getTransactions();BigDecimal nTransactions = new BigDecimal(transactions.size());Observable.from(transactions)        .map(transaction -> transaction.amount)        .reduce(BigDecimal::add)        .map(total -> total.divide(nTransactions, 2, BigDecimal.ROUND_DOWN))        .map(mean -> String.format(The mean is %s, mean.toPlainString()))        .subscribe(System.out::println);I'd like to know if this could be done better.
Finding the mean using RxJava
java;statistics;rx java