BitcoinCoreAdapters { public static AccountInfo adaptAccountInfo( BitcoinCoreBalanceResponse available, BitcoinCoreBalanceResponse unconfirmed) { BigDecimal total = available.getAmount().add(unconfirmed.getAmount()); Balance btc = new Balance(Currency.BTC, total, available.getAmount(), unconfirmed.getAmount()); Wallet wallet = Wallet.Builder.from(Arrays.asList(btc)).build(); return new AccountInfo(wallet); }  static AccountInfo adaptAccountInfo(
      BitcoinCoreBalanceResponse available, BitcoinCoreBalanceResponse unconfirmed);  }
@Test public void adaptAccountInfoTest() throws JsonParseException, JsonMappingException, IOException { ObjectMapper mapper = new ObjectMapper(); InputStream getBalance = getClass().getResourceAsStream("/account/example-getbalance.json"); BitcoinCoreBalanceResponse available = mapper.readValue(getBalance, BitcoinCoreBalanceResponse.class); InputStream getUnconfirmedBalance = getClass().getResourceAsStream("/account/example-getunconfirmedbalance.json"); BitcoinCoreBalanceResponse unconfirmed = mapper.readValue(getUnconfirmedBalance, BitcoinCoreBalanceResponse.class); AccountInfo account = BitcoinCoreAdapters.adaptAccountInfo(available, unconfirmed); Balance btc = account.getWallet().getBalance(Currency.BTC); assertThat(btc.getAvailable()).isEqualTo(new BigDecimal("68480.47579046")); assertThat(btc.getFrozen()).isEqualTo(new BigDecimal("10.00000001")); assertThat(btc.getTotal()).isEqualTo(new BigDecimal("68490.47579047")); }