LgoAdapters { public static OrderBook adaptOrderBook(LgoOrderbook ob, CurrencyPair pair) { List<LimitOrder> bids = ob.getBids().stream() .map(e -> adaptEntryToLimitOrder(e, OrderType.BID, pair)) .collect(Collectors.toList()); List<LimitOrder> asks = ob.getAsks().stream() .map(e -> adaptEntryToLimitOrder(e, OrderType.ASK, pair)) .collect(Collectors.toList()); return new OrderBook(null, asks, bids, true); } private  LgoAdapters(); static ExchangeMetaData adaptMetadata(
      ExchangeMetaData metaData, LgoProducts products, LgoCurrencies currencies); static Stream<LgoKey> adaptKeysIndex(String indexFile); static LgoPlaceOrder adaptLimitOrder(LimitOrder limitOrder); static LgoPlaceOrder adaptEncryptedMarketOrder(MarketOrder marketOrder); static LgoPlaceOrder adaptEncryptedCancelOrder(String orderId, Date date); static LgoUnencryptedOrder adaptUnencryptedLimitOrder(LimitOrder limitOrder); static LgoUnencryptedOrder adaptUnencryptedMarketOrder(MarketOrder marketOrder); static String adaptCurrencyPair(CurrencyPair currencyPair); static UserTrades adaptUserTrades(WithCursor<LgoUserTrades> lastTrades); static OrderBook adaptOrderBook(LgoOrderbook ob, CurrencyPair pair); static LimitOrder adaptEntryToLimitOrder(
      Object[] entry, OrderType bid, CurrencyPair pair); static String adaptDateParam(Date date);  }
@Test public void adaptsOrderBook() throws IOException { LgoOrderbook lgoOrderbook = readResourceAs( "/org/knowm/xchange/lgo/marketdata/example-orderbook-data.json", new TypeReference<LgoOrderbook>() {}); OrderBook orderBook = LgoAdapters.adaptOrderBook(lgoOrderbook, CurrencyPair.BTC_USD); assertThat(orderBook).isNotNull(); assertThat(orderBook.getAsks()).hasSize(2); assertThat(orderBook.getBids()).hasSize(2); assertThat(orderBook.getAsks().get(0)) .isEqualTo( new LimitOrder( OrderType.ASK, new BigDecimal("4.44440000"), CurrencyPair.BTC_USD, null, null, new BigDecimal("2921.9000"))); assertThat(orderBook.getAsks().get(1)) .isEqualTo( new LimitOrder( OrderType.ASK, new BigDecimal("8.38460000"), CurrencyPair.BTC_USD, null, null, new BigDecimal("2926.5000"))); assertThat(orderBook.getBids().get(0)) .isEqualTo( new LimitOrder( OrderType.BID, new BigDecimal("8.35030000"), CurrencyPair.BTC_USD, null, null, new BigDecimal("2896.6000"))); assertThat(orderBook.getBids().get(1)) .isEqualTo( new LimitOrder( OrderType.BID, new BigDecimal("931.83050000"), CurrencyPair.BTC_USD, null, null, new BigDecimal("1850.0000"))); }