BityAdapters { public static List<Ticker> adaptTickers(Collection<BityTicker> bityTickers) { List<Ticker> tickers = new ArrayList<>(); for (BityTicker ticker : bityTickers) { tickers.add(adaptTicker(ticker)); } return tickers; } private  BityAdapters(); static UserTrades adaptTrades(List<BityOrder> orders); static UserTrade adaptTrade(BityOrder order); static ExchangeMetaData adaptMetaData(
      List<BityPair> rawSymbols, ExchangeMetaData metaData); static List<CurrencyPair> adaptCurrencyPairs(Collection<BityPair> bityPairs); static CurrencyPair adaptCurrencyPair(BityPair bityPair); static List<Ticker> adaptTickers(Collection<BityTicker> bityTickers); static Ticker adaptTicker(BityTicker bityTicker);  }
@Test public void testTickersAdapter() throws IOException { InputStream is = BityAdaptersTest.class.getResourceAsStream( "/org/knowm/xchange/bity/dto/marketdata/example-tickers-data.json"); ObjectMapper mapper = new ObjectMapper(); BityTickers tickers = mapper.readValue(is, BityTickers.class); assertThat(tickers).isNotNull(); is.close(); List<Ticker> tickersList = BityAdapters.adaptTickers(tickers.getObjects()); assertThat(tickersList).isNotEmpty(); BityTickersHolder tickersHolder = new BityTickersHolder(tickersList); Ticker ticker = tickersHolder.getTicker(new CurrencyPair("ETH", "CHF")); assertThat(ticker.getLast().toString()).isEqualTo("467.29460000"); assertThat(ticker.getBid().toString()).isEqualTo("460.21920000"); assertThat(ticker.getAsk().toString()).isEqualTo("475.53340000"); }