BTCTradeAdapters { public static OpenOrders adaptOpenOrders(BTCTradeOrder[] btcTradeOrders) { List<LimitOrder> openOrders = new ArrayList<>(btcTradeOrders.length); for (BTCTradeOrder order : btcTradeOrders) { LimitOrder limitOrder = adaptLimitOrder(order); if (limitOrder != null) { openOrders.add(limitOrder); } } return new OpenOrders(openOrders); } private  BTCTradeAdapters(); static Date adaptDatetime(String datetime); static CurrencyPair adaptCurrencyPair(String coin); static Ticker adaptTicker(BTCTradeTicker btcTradeTicker, CurrencyPair currencyPair); static OrderBook adaptOrderBook(BTCTradeDepth btcTradeDepth, CurrencyPair currencyPair); static Trades adaptTrades(BTCTradeTrade[] btcTradeTrades, CurrencyPair currencyPair); static boolean adaptResult(BTCTradeResult result); static Wallet adaptWallet(BTCTradeBalance balance); static String adaptDepositAddress(BTCTradeWallet wallet); static String adaptPlaceOrderResult(BTCTradePlaceOrderResult result); static OpenOrders adaptOpenOrders(BTCTradeOrder[] btcTradeOrders); static UserTrades adaptTrades(
      BTCTradeOrder[] btcTradeOrders, BTCTradeOrder[] btcTradeOrderDetails);  }
@Test public void testAdaptOpenOrders() throws IOException { BTCTradeOrder[] btcTradeOrders = mapper.readValue( getClass().getResource("dto/trade/orders-open.json"), BTCTradeOrder[].class); OpenOrders openOrders = BTCTradeAdapters.adaptOpenOrders(btcTradeOrders); List<LimitOrder> openOrderList = openOrders.getOpenOrders(); assertEquals(2, openOrderList.size()); LimitOrder order = openOrderList.get(0); assertEquals(CurrencyPair.LTC_CNY, order.getCurrencyPair()); assertEquals("16636810", order.getId()); assertEquals(new BigDecimal("1.01"), order.getLimitPrice()); assertEquals(1410670133000L, order.getTimestamp().getTime()); assertEquals(new BigDecimal("0.1"), order.getOriginalAmount()); assertEquals(OrderType.BID, order.getType()); order = openOrderList.get(1); assertEquals(CurrencyPair.BTC_CNY, order.getCurrencyPair()); assertEquals("16634460", order.getId()); assertEquals(new BigDecimal("10.01"), order.getLimitPrice()); assertEquals(1410669106000L, order.getTimestamp().getTime()); assertEquals(new BigDecimal("0.01"), order.getOriginalAmount()); assertEquals(OrderType.BID, order.getType()); }