KrakenAdapters { public static Ticker adaptTicker(KrakenTicker krakenTicker, CurrencyPair currencyPair) { Ticker.Builder builder = new Ticker.Builder(); builder.open(krakenTicker.getOpen()); builder.ask(krakenTicker.getAsk().getPrice()); builder.bid(krakenTicker.getBid().getPrice()); builder.last(krakenTicker.getClose().getPrice()); builder.high(krakenTicker.get24HourHigh()); builder.low(krakenTicker.get24HourLow()); builder.vwap(krakenTicker.get24HourVolumeAvg()); builder.volume(krakenTicker.get24HourVolume()); builder.currencyPair(currencyPair); return builder.build(); }  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 testAdaptTicker() throws IOException { InputStream is = KrakenAdaptersTest.class.getResourceAsStream( "/org/knowm/xchange/kraken/dto/marketdata/example-ticker-data.json"); ObjectMapper mapper = new ObjectMapper(); KrakenTickerResult krakenTicker = mapper.readValue(is, KrakenTickerResult.class); CurrencyPair currencyPair = CurrencyPair.BTC_EUR; String krakenCurencyPair = "XXBTZEUR"; Ticker ticker = KrakenAdapters.adaptTicker(krakenTicker.getResult().get(krakenCurencyPair), currencyPair); assertThat(ticker.getAsk()).isEqualTo(new BigDecimal("562.26651")); assertThat(ticker.getBid()).isEqualTo(new BigDecimal("560.46600")); assertThat(ticker.getLow()).isEqualTo(new BigDecimal("560.00000")); assertThat(ticker.getHigh()).isEqualTo(new BigDecimal("591.11000")); assertThat(ticker.getLast()).isEqualTo(new BigDecimal("560.87711")); assertThat(ticker.getVwap()).isEqualTo(new BigDecimal("576.77284")); assertThat(ticker.getVolume()).isEqualByComparingTo("600.91850325"); assertThat(ticker.getOpen()).isEqualTo(new BigDecimal("568.98910")); assertThat(ticker.getCurrencyPair().base.getCurrencyCode()) .isEqualTo(currencyPair.base.getCurrencyCode()); }