CryptopiaAdapters { public static OrderBook adaptOrderBook( CryptopiaOrderBook cryptopiaOrderBook, CurrencyPair currencyPair) { List<LimitOrder> asks = createOrders(currencyPair, Order.OrderType.ASK, cryptopiaOrderBook.getAsks()); List<LimitOrder> bids = createOrders(currencyPair, Order.OrderType.BID, cryptopiaOrderBook.getBids()); return new OrderBook(new Date(), asks, bids); } private  CryptopiaAdapters(); static Date convertTimestamp(String timestamp); static OrderBook adaptOrderBook(
      CryptopiaOrderBook cryptopiaOrderBook, CurrencyPair currencyPair); static Ticker adaptTicker(CryptopiaTicker cryptopiaTicker, CurrencyPair currencyPair); static Trades adaptTrades(List<CryptopiaMarketHistory> cryptopiaMarketHistory); static ExchangeMetaData adaptToExchangeMetaData(
      List<CryptopiaCurrency> cryptopiaCurrencies, List<CryptopiaTradePair> tradePairs);  }
@Test public void testOrderBookAdapter() throws IOException { InputStream is = CryptopiaAdaptersTest.class.getResourceAsStream( "/org/knowm/xchange/cryptopia/dto/marketdata/example-full-depth-data.json"); ObjectMapper mapper = new ObjectMapper(); CryptopiaBaseResponse<CryptopiaOrderBook> cryptopiaOrderBook = mapper.readValue(is, CryptopiaBaseResponseCryptopiaOrderBook.class); is.close(); OrderBook orderBook = CryptopiaAdapters.adaptOrderBook(cryptopiaOrderBook.getData(), CurrencyPair.ETH_BTC); assertThat(orderBook).isNotNull(); assertThat(orderBook.getBids().size()).isEqualTo(93); assertThat(orderBook.getBids().get(0).getLimitPrice().toString()).isEqualTo("0.07849890"); assertThat(orderBook.getBids().get(0).getType()).isEqualTo(Order.OrderType.BID); assertThat(orderBook.getBids().get(0).getOriginalAmount()) .isEqualTo(new BigDecimal("1.27390320")); assertThat(orderBook.getBids().get(0).getCurrencyPair()).isEqualTo(CurrencyPair.ETH_BTC); }