CryptopiaAdapters { public static ExchangeMetaData adaptToExchangeMetaData( List<CryptopiaCurrency> cryptopiaCurrencies, List<CryptopiaTradePair> tradePairs) { Map<CurrencyPair, CurrencyPairMetaData> marketMetaDataMap = new HashMap<>(); Map<Currency, CurrencyMetaData> currencyMetaDataMap = new HashMap<>(); for (CryptopiaCurrency cryptopiaCurrency : cryptopiaCurrencies) { currencyMetaDataMap.put( Currency.getInstance(cryptopiaCurrency.getSymbol()), new CurrencyMetaData(8, null)); } for (CryptopiaTradePair cryptopiaTradePair : tradePairs) { CurrencyPair currencyPair = CurrencyPairDeserializer.getCurrencyPairFromString(cryptopiaTradePair.getLabel()); CurrencyPairMetaData currencyPairMetaData = new CurrencyPairMetaData( cryptopiaTradePair.getTradeFee(), cryptopiaTradePair.getMinimumTrade(), cryptopiaTradePair.getMaximumTrade(), 8, null); marketMetaDataMap.put(currencyPair, currencyPairMetaData); } return new ExchangeMetaData(marketMetaDataMap, currencyMetaDataMap, null, null, null); } private  CryptopiaAdapters(); static Date convertTimestamp(String timestamp); static OrderBook adaptOrderBook(
      CryptopiaOrderBook cryptopiaOrderBook, CurrencyPair currencyPair); static Ticker adaptTicker(CryptopiaTicker cryptopiaTicker, CurrencyPair currencyPair); static Trades adaptTrades(List<CryptopiaMarketHistory> cryptopiaMarketHistory); static ExchangeMetaData adaptToExchangeMetaData(
      List<CryptopiaCurrency> cryptopiaCurrencies, List<CryptopiaTradePair> tradePairs);  }
@Test public void testExchangeMetaDataAdapter() throws IOException { InputStream is = CryptopiaAdaptersTest.class.getResourceAsStream( "/org/knowm/xchange/cryptopia/dto/marketdata/example-currencies.json"); ObjectMapper mapper = new ObjectMapper(); CryptopiaBaseResponse<List<CryptopiaCurrency>> cryptopiaCurrencies = mapper.readValue(is, CryptopiaBaseResponseCryptopiaCurrency.class); is.close(); assertThat(cryptopiaCurrencies).isNotNull(); is = CryptopiaAdaptersTest.class.getResourceAsStream( "/org/knowm/xchange/cryptopia/dto/marketdata/example-trade-pairs.json"); CryptopiaBaseResponse<List<CryptopiaTradePair>> cryptopiaTradePairs = mapper.readValue(is, CryptopiaBaseResponseCryptopiaTradePair.class); is.close(); assertThat(cryptopiaTradePairs).isNotNull(); ExchangeMetaData exchangeMetaData = CryptopiaAdapters.adaptToExchangeMetaData( cryptopiaCurrencies.getData(), cryptopiaTradePairs.getData()); assertThat(exchangeMetaData).isNotNull(); assertThat(exchangeMetaData.getCurrencies()).containsKey(Currency.ETH); assertThat(exchangeMetaData.getCurrencies().get(Currency.ETH).getScale()).isEqualTo(8); assertThat(exchangeMetaData.getCurrencyPairs()).containsKey(CurrencyPair.ETH_BTC); assertThat( exchangeMetaData .getCurrencyPairs() .get(CurrencyPair.ETH_BTC) .getTradingFee() .toString()) .isEqualTo("0.20000000"); }