CoinbaseProAdapters { public static Ticker adaptTicker( CoinbaseProProductTicker ticker, CoinbaseProProductStats stats, CurrencyPair currencyPair) { BigDecimal last = ticker.getPrice(); BigDecimal open = stats.getOpen(); BigDecimal high = stats.getHigh(); BigDecimal low = stats.getLow(); BigDecimal buy = ticker.getBid(); BigDecimal sell = ticker.getAsk(); BigDecimal volume = ticker.getVolume(); Date date = parseDate(ticker.getTime()); return new Ticker.Builder() .currencyPair(currencyPair) .last(last) .open(open) .high(high) .low(low) .bid(buy) .ask(sell) .volume(volume) .timestamp(date) .build(); } 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 testTickerAdapter() throws IOException { InputStream is = CoinbaseProAdaptersTest.class.getResourceAsStream( "/org/knowm/xchange/coinbasepro/dto/marketdata/example-ticker-data.json"); InputStream is2 = CoinbaseProAdaptersTest.class.getResourceAsStream( "/org/knowm/xchange/coinbasepro/dto/marketdata/example-stats-data.json"); ObjectMapper mapper = new ObjectMapper(); CoinbaseProProductTicker coinbaseExTicker = mapper.readValue(is, CoinbaseProProductTicker.class); CoinbaseProProductStats coinbaseExStats = mapper.readValue(is2, CoinbaseProProductStats.class); Ticker ticker = CoinbaseProAdapters.adaptTicker(coinbaseExTicker, coinbaseExStats, CurrencyPair.BTC_USD); assertThat(ticker.getLast().toString()).isEqualTo("246.28000000"); assertThat(ticker.getOpen().toString()).isEqualTo("254.04000000"); assertThat(ticker.getBid().toString()).isEqualTo("637"); assertThat(ticker.getAsk().toString()).isEqualTo("637.11"); assertThat(ticker.getHigh().toString()).isEqualTo("255.47000000"); assertThat(ticker.getLow().toString()).isEqualTo("244.29000000"); assertThat(ticker.getVolume()).isEqualTo(new BigDecimal("4661.70407704")); SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); f.setTimeZone(TimeZone.getTimeZone("UTC")); String dateString = f.format(ticker.getTimestamp()); assertThat(dateString).isEqualTo("2015-04-08 20:49:06"); }