class BitcoinChartsAdapters {

  /** private Constructor */
  private BitcoinChartsAdapters() {}

  /**
   * Adapts a BitcoinChartsTicker[] to a Ticker Object
   *
   * @param bitcoinChartsTickers
   * @return
   */
  public static Ticker adaptTicker(
      BitcoinChartsTicker[] bitcoinChartsTickers, CurrencyPair currencyPair) {<FILL_FUNCTION_BODY>}

  public static ExchangeMetaData adaptMetaData(
      ExchangeMetaData exchangeMetaData, BitcoinChartsTicker[] tickers) {

    Map<Instrument, InstrumentMetaData> pairs = new HashMap<>();

    for (BitcoinChartsTicker ticker : tickers) {
      BigDecimal anyPrice =
          firstNonNull(
              ticker.getAsk(),
              ticker.getBid(),
              ticker.getClose(),
              ticker.getHigh(),
              ticker.getHigh());
      int scale = anyPrice != null ? anyPrice.scale() : 0;
      pairs.put(
          new CurrencyPair(Currency.BTC, Currency.getInstance(ticker.getSymbol())),
          new InstrumentMetaData.Builder().priceScale(scale).build());
    }

    return new ExchangeMetaData(
        pairs,
        exchangeMetaData.getCurrencies(),
        exchangeMetaData.getPublicRateLimits(),
        exchangeMetaData.getPrivateRateLimits(),
        exchangeMetaData.isShareRateLimits());
  }

  private static <T> T firstNonNull(T... objects) {

    for (T o : objects) {
      if (o != null) {
        return o;
      }
    }
    return null;
  }
}


    for (BitcoinChartsTicker bitcoinChartsTicker : bitcoinChartsTickers) {
      if (bitcoinChartsTicker.getSymbol().equals(currencyPair.counter.getCurrencyCode())) {

        BigDecimal last =
            bitcoinChartsTicker.getClose() != null ? bitcoinChartsTicker.getClose() : null;
        BigDecimal bid = bitcoinChartsTicker.getBid() != null ? bitcoinChartsTicker.getBid() : null;
        BigDecimal ask = bitcoinChartsTicker.getAsk() != null ? bitcoinChartsTicker.getAsk() : null;
        BigDecimal high =
            bitcoinChartsTicker.getHigh() != null ? bitcoinChartsTicker.getHigh() : null;
        BigDecimal low = bitcoinChartsTicker.getLow() != null ? bitcoinChartsTicker.getLow() : null;
        BigDecimal volume = bitcoinChartsTicker.getVolume();
        Date timeStamp = new Date(bitcoinChartsTicker.getLatestTrade() * 1000L);

        return new Ticker.Builder()
            .currencyPair(currencyPair)
            .instrument(currencyPair)
            .last(last)
            .bid(bid)
            .ask(ask)
            .high(high)
            .low(low)
            .volume(volume)
            .timestamp(timeStamp)
            .build();
      }
    }
    return null;
  
<no_super_class>