LgoAdapters { public static UserTrades adaptUserTrades(WithCursor<LgoUserTrades> lastTrades) { List<UserTrade> trades = lastTrades.getResult().getTrades().stream() .map(LgoAdapters::adaptUserTrade) .collect(Collectors.toList()); return new UserTrades(trades, 0L, Trades.TradeSortType.SortByID, lastTrades.getNextPage()); } 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 adaptsUserTrades() throws IOException, ParseException { WithCursor<LgoUserTrades> lastTrades = readResourceAs( "/org/knowm/xchange/lgo/trade/example-trades-data.json", new TypeReference<WithCursor<LgoUserTrades>>() {}); UserTrades userTrades = LgoAdapters.adaptUserTrades(lastTrades); assertThat(userTrades.getNextPageCursor()).isEqualTo("aGVsbG8="); assertThat(userTrades.getUserTrades()).hasSize(2); assertThat(userTrades.getUserTrades().get(0)) .isEqualToComparingFieldByField( new UserTrade.Builder() .type(OrderType.ASK) .originalAmount(new BigDecimal("0.00500000")) .currencyPair(CurrencyPair.BTC_USD) .price(new BigDecimal("3854.0000")) .timestamp(dateFormat.parse("2019-03-05T16:37:17.220Z")) .id("2") .orderId("155180383648300001") .feeAmount(new BigDecimal("0.0096")) .feeCurrency(Currency.USD) .build()); assertThat(userTrades.getUserTrades().get(1)) .isEqualToComparingFieldByField( new UserTrade.Builder() .type(OrderType.BID) .originalAmount(new BigDecimal("0.00829566")) .currencyPair(CurrencyPair.BTC_USD) .price(new BigDecimal("2410.9000")) .timestamp(dateFormat.parse("2019-06-20T15:37:21.855Z")) .id("2477363") .orderId("156104504046400001") .feeAmount(new BigDecimal("0.0100")) .feeCurrency(Currency.USD) .build()); }