CryptowatchAdapters { public static Trades adaptToTrades( List<CryptowatchTrade> cryptowatchTrades, CurrencyPair currencyPair) { List<Trade> trades = cryptowatchTrades.stream() .map( x -> new Trade.Builder() .originalAmount(x.getAmount()) .currencyPair(currencyPair) .price(x.getPrice()) .timestamp(new Date(x.getTimestamp())) .build()) .collect(Collectors.toList()); long last = trades.get(trades.size() - 1).getTimestamp().getTime(); return new Trades(trades, last, Trades.TradeSortType.SortByTimestamp); }  static ExchangeMetaData adaptToExchangeMetaData(
      ExchangeMetaData exchangeMetaData,
      List<CryptowatchAssetPair> assetPairs,
      List<CryptowatchAsset> assets); static CurrencyPair adaptToCurrencyPair(CryptowatchAssetPair pair); static OrderBook adaptToOrderbook(CryptowatchOrderBook book, CurrencyPair currencyPair); static Trades adaptToTrades(
      List<CryptowatchTrade> cryptowatchTrades, CurrencyPair currencyPair); static String adaptCurrencyPair(CurrencyPair pair);  }
@Test public void adaptToTrades() throws IOException { List<CryptowatchTrade> cryptowatchTrades = TestUtils.getObject( "/org/knowm/xchange/cryptowatch/marketdata/example-trades-results.json", CryptowatchTradesResult.class) .getResult(); Trades trades = CryptowatchAdapters.adaptToTrades(cryptowatchTrades, CurrencyPair.BTC_EUR); assertNotNull(trades); }