@Test
public void getTotal() {

    List<Wallet> list = new ArrayList<>();
    Wallet wallet = new Wallet();
    wallet.setCreateTime(1115448481);
    wallet.setName("001");
    AccountBalance balance = new AccountBalance();
    balance.setFree("10000000084489");
    balance.setLock("0");
    wallet.setAccountBalance(balance);
    list.add(wallet);
    Wallet wallet2 = new Wallet();
    wallet2.setCreateTime(1115448485);
    wallet2.setName("002");
    AccountBalance balance2 = new AccountBalance();
    balance2.setFree("1000000005655655");
    balance2.setLock("0");
    wallet2.setAccountBalance(balance2);
    list.add(wallet2);
    Wallet wallet3 = new Wallet();
    wallet3.setName("003");
    wallet3.setCreateTime(1115448483);
    AccountBalance balance3 = new AccountBalance();
    balance3.setFree("10000000056556584855");
    balance3.setLock("0");
    wallet3.setAccountBalance(balance3);
    list.add(wallet3);
    Wallet wallet4 = new Wallet();
    wallet4.setName("004");
    wallet4.setCreateTime(1115448486);
    AccountBalance balance4 = new AccountBalance();
    balance4.setFree("1000000001156584855");
    balance4.setLock("0");
    wallet4.setAccountBalance(balance4);
    list.add(wallet4);
    Flowable.fromIterable(list)
            .map(new Function<Wallet, AccountBalance>() {
                @Override
                public AccountBalance apply(Wallet wallet) throws Exception {
                    return wallet.getAccountBalance();
                }
            }).map(new Function<AccountBalance, BigDecimal>() {
        @Override
        public BigDecimal apply(AccountBalance accountBalance) throws Exception {
            return new BigDecimal(accountBalance.getFree());
        }
    }).reduce(new BiFunction<BigDecimal, BigDecimal, BigDecimal>() {
        @Override
        public BigDecimal apply(BigDecimal balance1, BigDecimal balance2) throws Exception {
            Log.d("============", "--------->" + balance1.add(balance2));
            return balance1.add(balance2);
        }
    }).toObservable();
}