KrakenAdapters { public static OrdersContainer adaptOrders( List<KrakenPublicOrder> orders, CurrencyPair currencyPair, OrderType orderType) { long maxTimestamp = -1 * Long.MAX_VALUE; List<LimitOrder> limitOrders = new ArrayList<>(orders.size()); for (KrakenPublicOrder order : orders) { if (order.getTimestamp() > maxTimestamp) { maxTimestamp = order.getTimestamp(); } limitOrders.add(adaptOrder(order, orderType, currencyPair)); } return new OrdersContainer( (String.valueOf(maxTimestamp).length() >= 13) ? maxTimestamp : maxTimestamp * 1000, limitOrders); }  static OrderBook adaptOrderBook(KrakenDepth krakenDepth, CurrencyPair currencyPair); static OrdersContainer adaptOrders(
      List<KrakenPublicOrder> orders, CurrencyPair currencyPair, OrderType orderType); static List<Order> adaptOrders(Map<String, KrakenOrder> krakenOrdersMap); static Order adaptOrder(String orderId, KrakenOrder krakenOrder); static LimitOrder adaptOrder(
      KrakenPublicOrder order, OrderType orderType, CurrencyPair currencyPair); static Ticker adaptTicker(KrakenTicker krakenTicker, CurrencyPair currencyPair); static List<Ticker> adaptTickers(Map<String, KrakenTicker> krackenTickers); static Trades adaptTrades(
      List<KrakenPublicTrade> krakenTrades, CurrencyPair currencyPair, long last); static Trade adaptTrade(KrakenPublicTrade krakenPublicTrade, CurrencyPair currencyPair); static Wallet adaptWallet(Map<String, BigDecimal> krakenWallet); static Set<CurrencyPair> adaptCurrencyPairs(Collection<String> krakenCurrencyPairs); static Currency adaptCurrency(String krakenCurrencyCode); static CurrencyPair adaptCurrencyPair(String krakenCurrencyPair); static OpenOrders adaptOpenOrders(Map<String, KrakenOrder> krakenOrders); static UserTrades adaptTradesHistory(Map<String, KrakenTrade> krakenTrades); static KrakenUserTrade adaptTrade(KrakenTrade krakenTrade, String tradeId); static OrderType adaptOrderType(KrakenType krakenType); static String adaptKrakenDepositAddress(KrakenDepositAddress[] krakenDepositAddress); static String adaptOrderId(KrakenOrderResponse orderResponse); static ExchangeMetaData adaptToExchangeMetaData(
      ExchangeMetaData originalMetaData,
      Map<String, KrakenAssetPair> krakenPairs,
      Map<String, KrakenAsset> krakenAssets); static List<FundingRecord> adaptFundingHistory(
      Map<String, KrakenLedger> krakenLedgerInfo); static OrderStatus adaptOrderStatus(KrakenOrderStatus status);  }
@Test public void testAdaptMarketOrder() throws IOException { InputStream is = KrakenAdaptersTest.class.getResourceAsStream( "/org/knowm/xchange/kraken/dto/order/example-market-ask-order.json"); ObjectMapper mapper = new ObjectMapper(); KrakenQueryOrderResult krakenQueryOrderResult = mapper.readValue(is, KrakenQueryOrderResult.class); List<Order> orders = KrakenAdapters.adaptOrders(krakenQueryOrderResult.getResult()); assertThat(orders.size()).isEqualTo(1); Order order = orders.get(0); assertThat(order.getId()).isEqualTo("OHR2QC-2XDSQ-WHOFMW"); assertThat(order.getAveragePrice()).isEqualTo(new BigDecimal("260.23")); assertThat(order.getCumulativeAmount()).isEqualTo(new BigDecimal("0.84962599")); assertThat(order.getCurrencyPair()).isEqualTo(CurrencyPair.LTC_USD); assertThat(MarketOrder.class.isAssignableFrom(order.getClass())); }