HitbtcAdapters { public static Wallet adaptWallet(String name, List<HitbtcBalance> hitbtcBalances) { List<Balance> balances = new ArrayList<>(hitbtcBalances.size()); for (HitbtcBalance balanceRaw : hitbtcBalances) { Currency currency = Currency.getInstance(balanceRaw.getCurrency()); Balance balance = new Balance(currency, null, balanceRaw.getAvailable(), balanceRaw.getReserved()); balances.add(balance); } return Wallet.Builder.from(balances).id(name).name(name).build(); }  static CurrencyPair adaptSymbol(String symbol); static CurrencyPair adaptSymbol(HitbtcSymbol hitbtcSymbol); static Ticker adaptTicker(HitbtcTicker hitbtcTicker, CurrencyPair currencyPair); static List<Ticker> adaptTickers(Map<String, HitbtcTicker> hitbtcTickers); static OrderBook adaptOrderBook(
      HitbtcOrderBook hitbtcOrderBook, CurrencyPair currencyPair); static OrderType adaptSide(HitbtcSide side); static Trades adaptTrades(
      List<? extends HitbtcTrade> allHitbtcTrades, CurrencyPair currencyPair); static LimitOrder adaptOrder(HitbtcOrder hitbtcOrder); static List<LimitOrder> adaptOrders(List<HitbtcOrder> openOrdersRaw); static OpenOrders adaptOpenOrders(List<HitbtcOrder> openOrdersRaw); static OrderType adaptOrderType(String side); static UserTrades adaptTradeHistory(List<HitbtcOwnTrade> tradeHistoryRaw); static Wallet adaptWallet(String name, List<HitbtcBalance> hitbtcBalances); static String adaptCurrencyPair(CurrencyPair pair); static HitbtcSide getSide(OrderType type); static ExchangeMetaData adaptToExchangeMetaData(
      List<HitbtcSymbol> symbols,
      Map<Currency, CurrencyMetaData> currencies,
      Map<CurrencyPair, CurrencyPairMetaData> currencyPairs); static FundingRecord adapt(HitbtcTransaction transaction);  }
@Test public void testAdaptWallet_getBalance() { try { List<HitbtcBalance> main = new ArrayList<>(); main.add(new HitbtcBalance("BTC", new BigDecimal("0.1234"), new BigDecimal("32.23"))); List<HitbtcBalance> trading = new ArrayList<>(); trading.add(new HitbtcBalance("BTC", new BigDecimal("0.111"), BigDecimal.ZERO)); AccountInfo accountInfo = new AccountInfo( HitbtcAdapters.adaptWallet("Main", main), HitbtcAdapters.adaptWallet("Trading", trading)); assertThat(accountInfo).isNotNull(); accountInfo.getWallet().getBalance(Currency.BTC); } catch (Exception e) { assertThat(e instanceof UnsupportedOperationException); assertThat(e.getMessage().equals("2 wallets in account")); } }