LgoAdapters { public static LgoPlaceOrder adaptEncryptedMarketOrder(MarketOrder marketOrder) { String product = adaptCurrencyPair(marketOrder.getCurrencyPair()); String side = adaptOrderType(marketOrder.getType()); return new LgoPlaceMarketOrder( 0, side, product, marketOrder.getOriginalAmount(), marketOrder.getTimestamp().toInstant()); } 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 adaptsBidMarketOrder() { Date now = new Date(); MarketOrder marketOrder = new MarketOrder(OrderType.BID, new BigDecimal("1"), CurrencyPair.BTC_USD, null, now); LgoPlaceOrder bidOrder = LgoAdapters.adaptEncryptedMarketOrder(marketOrder); assertThat(bidOrder) .isEqualToComparingFieldByField( new LgoPlaceMarketOrder(0, "B", "BTC-USD", new BigDecimal("1"), now.toInstant())); }
@Test public void adaptsAskMarketOrder() { Date timestamp = new Date(); MarketOrder marketOrder = new MarketOrder(OrderType.ASK, new BigDecimal("1"), CurrencyPair.BTC_USD, null, timestamp); LgoPlaceOrder bidOrder = LgoAdapters.adaptEncryptedMarketOrder(marketOrder); assertThat(bidOrder) .isEqualToComparingFieldByField( new LgoPlaceMarketOrder(0, "S", "BTC-USD", new BigDecimal("1"), timestamp.toInstant())); }