KrakenAdapters { public static Trades adaptTrades( List<KrakenPublicTrade> krakenTrades, CurrencyPair currencyPair, long last) { List<Trade> trades = new ArrayList<>(); for (KrakenPublicTrade krakenTrade : krakenTrades) { trades.add(adaptTrade(krakenTrade, currencyPair)); } return new Trades(trades, last, TradeSortType.SortByTimestamp); }  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 testAdaptTrades() throws IOException { InputStream is = KrakenAdaptersTest.class.getResourceAsStream( "/org/knowm/xchange/kraken/dto/marketdata/example-trades-data.json"); ObjectMapper mapper = new ObjectMapper(); KrakenPublicTradesResult krakenTrades = mapper.readValue(is, KrakenPublicTradesResult.class); Trades trades = KrakenAdapters.adaptTrades( krakenTrades.getResult().getTrades(), CurrencyPair.BTC_USD, krakenTrades.getResult().getLast()); Assert.assertEquals(14, trades.getTrades().size()); assertThat(trades.getTrades().get(0).getPrice()).isEqualTo("1023.82219"); assertThat(trades.getTrades().get(0).getType()).isEqualTo(OrderType.ASK); assertThat(trades.getTrades().get(0).getTimestamp()).isEqualTo(new Date(1385579841777L)); assertThat(trades.getTrades().get(1).getOriginalAmount()).isEqualTo("0.01500000"); assertThat(trades.getlastID()).isEqualTo(1385579841881785998L); }