CoinbaseProAdapters { public static UserTrades adaptTradeHistory(CoinbaseProFill[] coinbaseExFills) { List<UserTrade> trades = new ArrayList<>(coinbaseExFills.length); for (CoinbaseProFill fill : coinbaseExFills) { OrderType type = fill.getSide().equals("buy") ? OrderType.BID : OrderType.ASK; CurrencyPair currencyPair = new CurrencyPair(fill.getProductId().replace('-', '/')); UserTrade t = new UserTrade.Builder() .type(type) .originalAmount(fill.getSize()) .currencyPair(currencyPair) .price(fill.getPrice()) .timestamp(parseDate(fill.getCreatedAt())) .id(String.valueOf(fill.getTradeId())) .orderId(fill.getOrderId()) .feeAmount(fill.getFee()) .feeCurrency(currencyPair.counter) .build(); trades.add(t); } return new UserTrades(trades, TradeSortType.SortByID); } private  CoinbaseProAdapters(); static CurrencyPair toCurrencyPair(final String productId); static Ticker adaptTicker(
      CoinbaseProProductTicker ticker, CoinbaseProProductStats stats, CurrencyPair currencyPair); static OrderBook adaptOrderBook(
      CoinbaseProProductBook book, CurrencyPair currencyPair, Date date); static OrderBook adaptOrderBook(CoinbaseProProductBook book, CurrencyPair currencyPair); static Wallet adaptAccountInfo(CoinbaseProAccount[] coinbaseProAccounts); @SuppressWarnings("unchecked") static OpenOrders adaptOpenOrders(CoinbaseProOrder[] coinbaseExOpenOrders); static Order adaptOrder(CoinbaseProOrder order); static OrderStatus[] adaptOrderStatuses(CoinbaseProOrder[] orders); static OrderStatus adaptOrderStatus(CoinbaseProOrder order); static Trades adaptTrades(
      List<CoinbaseProTrade> coinbaseProTradesList, CurrencyPair currencyPair); static UserTrades adaptTradeHistory(CoinbaseProFill[] coinbaseExFills); static Trades adaptTrades(CoinbaseProTrade[] coinbaseExTrades, CurrencyPair currencyPair); static CurrencyPair adaptCurrencyPair(CoinbaseProProduct product); static ExchangeMetaData adaptToExchangeMetaData(
      ExchangeMetaData exchangeMetaData,
      CoinbaseProProduct[] products,
      CoinbaseProCurrency[] cbCurrencies); static String adaptProductID(CurrencyPair currencyPair); static CoinbaseProPlaceOrder.Side adaptSide(OrderType orderType); static CoinbaseProPlaceOrder.Stop adaptStop(OrderType orderType); static CoinbaseProPlaceLimitOrder adaptCoinbaseProPlaceLimitOrder(LimitOrder limitOrder); static CoinbaseProPlaceMarketOrder adaptCoinbaseProPlaceMarketOrder(
      MarketOrder marketOrder); static CoinbaseProPlaceOrder adaptCoinbaseProStopOrder(StopOrder stopOrder); static FundingRecord adaptFundingRecord(
      Currency currency, CoinbaseProTransfer coinbaseProTransfer);  }
@Test public void testTradeHistoryAdapter() throws IOException { JacksonObjectMapperFactory factory = new DefaultJacksonObjectMapperFactory(); ObjectMapper mapper = factory.createObjectMapper(); InputStream is = getClass() .getResourceAsStream("/org/knowm/xchange/coinbasepro/dto/trade/example-fills.json"); CoinbaseProFill[] fills = mapper.readValue(is, CoinbaseProFill[].class); UserTrades trades = CoinbaseProAdapters.adaptTradeHistory(fills); assertThat(trades.getUserTrades()).hasSize(1); UserTrade trade = trades.getUserTrades().get(0); assertThat(trade.getId()).isEqualTo("470768"); assertThat(trade.getCurrencyPair()).isEqualTo(CurrencyPair.ETH_BTC); assertThat(trade.getPrice()).isEqualTo("0.05915000"); assertThat(trade.getOriginalAmount()).isEqualTo("0.01000000"); assertThat(trade.getOrderId()).isEqualTo("b4b3bbb1-e0e3-4532-9413-23123448ce35"); assertThat(trade.getTimestamp().getTime()).isEqualTo(1493623910243L); assertThat(trade.getFeeAmount()).isEqualTo("0.0000017745000000"); assertThat(trade.getType()).isEqualTo(OrderType.BID); }