BitcointoyouAdapters { static List<LimitOrder> adaptBitcointoyouPublicOrders( List<List<BigDecimal>> list, OrderType orderType, CurrencyPair currencyPair) { List<BitcointoyouLevel> levels = new ArrayList<>(); for (List<BigDecimal> rawLevel : list) { levels.add(adaptRawBitcointoyouLevel(rawLevel)); } List<LimitOrder> orders = new ArrayList<>(); for (BitcointoyouLevel level : levels) { LimitOrder limitOrder = new LimitOrder.Builder(orderType, currencyPair) .originalAmount(level.getAmount()) .limitPrice(level.getLimit()) .build(); orders.add(limitOrder); } return orders; } private  BitcointoyouAdapters(); static Ticker adaptBitcointoyouTicker(
      BitcointoyouTicker bitcointoyouTicker, CurrencyPair currencyPair); static OrderBook adaptBitcointoyouOrderBook(
      BitcointoyouOrderBook depth, CurrencyPair currencyPair); static Trades adaptBitcointoyouPublicTrades(
      BitcointoyouPublicTrade[] bitcointoyouPublicTrades, CurrencyPair currencyPair); static List<Balance> adaptBitcointoyouBalances(BitcointoyouBalance bitcointoyouBalances); static OpenOrders adaptBitcointoyouOpenOrders(
      BitcointoyouOrderResponse bitcointoyouOpenOrders); static Collection<Order> adaptBitcointoyouOrderToOrdersCollection(
      BitcointoyouOrderResponse bitcointoyouOrderResponse);  }
@Test public void testPublicOrdersAdapter() throws Exception { final SoftAssertions softly = new SoftAssertions(); List<LimitOrder> bidsOrders = BitcointoyouAdapters.adaptBitcointoyouPublicOrders( bitcointoyouOrderBook.getBids(), Order.OrderType.BID, null); softly.assertThat(bidsOrders.size()).isEqualTo(325); softly .assertThat(bidsOrders.get(300).getOriginalAmount()) .isEqualTo(new BigDecimal("0.000104710000000")); List<LimitOrder> asksOrders = BitcointoyouAdapters.adaptBitcointoyouPublicOrders( bitcointoyouOrderBook.getAsks(), Order.OrderType.ASK, null); softly.assertThat(asksOrders.size()).isEqualTo(515); softly .assertThat(asksOrders.get(300).getLimitPrice()) .isEqualTo(new BigDecimal("55900.230000000000000")); softly.assertAll(); }