BithumbAdapters { public static OrderBook adaptOrderBook(BithumbOrderbook orderbook) { final CurrencyPair currencyPair = new CurrencyPair(orderbook.getOrderCurrency(), orderbook.getPaymentCurrency()); return new OrderBook( new Date(orderbook.getTimestamp()), createOrder(currencyPair, orderbook.getAsks(), Order.OrderType.ASK), createOrder(currencyPair, orderbook.getBids(), Order.OrderType.BID)); } private  BithumbAdapters(); static OrderBook adaptOrderBook(BithumbOrderbook orderbook); static AccountInfo adaptAccountInfo(BithumbAccount account, BithumbBalance balance); static Ticker adaptTicker(BithumbTicker bithumbTicker, CurrencyPair currencyPair); static List<Ticker> adaptTickers(BithumbTickersReturn bithumbTickers); static Trades adaptTransactions(
      List<BithumbTransactionHistory> bithumbTrades, CurrencyPair currencyPair); static Trade adaptTransactionHistory(
      BithumbTransactionHistory trade, CurrencyPair currencyPair); static OpenOrders adaptOrders(List<BithumbOrder> bithumbOrders); static LimitOrder adaptOrder(BithumbOrder order); static UserTrades adaptUserTrades(
      List<BithumbUserTransaction> transactions, CurrencyPair currencyPair); static Order adaptOrderDetail(BithumbOrderDetail order, String id); static CurrencyPair adaptCurrencyPair(String orderCurrency, String paymentCurrency); static final String SEARCH_BUY; static final String SEARCH_SELL; }
@Test public void testAdaptOrderBook() throws IOException { InputStream is = BithumbAdaptersTest.class.getResourceAsStream( "/org/knowm/xchange/bithumb/dto/marketdata/example-orderbook.json"); final BithumbOrderbook bitstampOrderBook = mapper.readValue(is, BithumbOrderbook.class); final OrderBook orderBook = BithumbAdapters.adaptOrderBook(bitstampOrderBook); assertThat(orderBook.getAsks()).hasSize(2); assertThat(orderBook.getBids()).hasSize(2); final LimitOrder ask = orderBook.getAsks().get(0); final LimitOrder bid = orderBook.getBids().get(0); assertThat(ask.getLimitPrice()).isEqualTo(new BigDecimal(168500L)); assertThat(ask.getOriginalAmount()).isEqualTo(new BigDecimal("49.5577")); assertThat(bid.getLimitPrice()).isEqualTo(new BigDecimal(168400L)); assertThat(bid.getOriginalAmount()).isEqualTo(new BigDecimal("28.0241")); }