LgoAdapters { public static ExchangeMetaData adaptMetadata( ExchangeMetaData metaData, LgoProducts products, LgoCurrencies currencies) { Map<CurrencyPair, CurrencyPairMetaData> currencyPairs = metaData.getCurrencyPairs(); Map<Currency, CurrencyMetaData> currency = metaData.getCurrencies(); for (LgoCurrency lgoCurrency : currencies.getCurrencies()) { currency.put( Currency.getInstance(lgoCurrency.getCode()), new CurrencyMetaData(lgoCurrency.getDecimals(), null)); } for (LgoProduct product : products.getProducts()) { BigDecimal minAmount = product.getBase().getLimits().getMin(); BigDecimal maxAmount = product.getBase().getLimits().getMax(); Integer baseScale = currency.get(Currency.getInstance(product.getBase().getId())).getScale(); BigDecimal increment = product.getQuote().getIncrement().stripTrailingZeros(); currencyPairs.put( toPair(product), new CurrencyPairMetaData( null, minAmount, maxAmount, null, null, baseScale, increment.scale(), new FeeTier[0], increment, Currency.USD, true)); } return metaData; } private  LgoAdapters(); static ExchangeMetaData adaptMetadata(
      ExchangeMetaData metaData, LgoProducts products, LgoCurrencies currencies); static Stream<LgoKey> adaptKeysIndex(String indexFile); static LgoPlaceOrder adaptLimitOrder(LimitOrder limitOrder); static LgoPlaceOrder adaptEncryptedMarketOrder(MarketOrder marketOrder); static LgoPlaceOrder adaptEncryptedCancelOrder(String orderId, Date date); static LgoUnencryptedOrder adaptUnencryptedLimitOrder(LimitOrder limitOrder); static LgoUnencryptedOrder adaptUnencryptedMarketOrder(MarketOrder marketOrder); static String adaptCurrencyPair(CurrencyPair currencyPair); static UserTrades adaptUserTrades(WithCursor<LgoUserTrades> lastTrades); static OrderBook adaptOrderBook(LgoOrderbook ob, CurrencyPair pair); static LimitOrder adaptEntryToLimitOrder(
      Object[] entry, OrderType bid, CurrencyPair pair); static String adaptDateParam(Date date);  }
@Test public void adaptsMetadata() { ExchangeMetaData metaData = LgoAdapters.adaptMetadata(emptyMeta(), products(), currencies()); assertThat(metaData).isNotNull(); assertThat(metaData.getCurrencies()).hasSize(2).containsKeys(Currency.BTC, Currency.USD); assertThat(metaData.getCurrencies().get(Currency.BTC)) .isEqualToComparingFieldByField(new CurrencyMetaData(8, null)); assertThat(metaData.getCurrencies().get(Currency.USD)) .isEqualToComparingFieldByField(new CurrencyMetaData(4, null)); assertThat(metaData.getCurrencyPairs()).hasSize(1).containsKeys(CurrencyPair.BTC_USD); }