LgoAdapters { public static LgoPlaceOrder adaptLimitOrder(LimitOrder limitOrder) { String product = adaptCurrencyPair(limitOrder.getCurrencyPair()); String side = adaptOrderType(limitOrder.getType()); return new LgoPlaceLimitOrder( 0, side, product, limitOrder.getOriginalAmount(), limitOrder.getLimitPrice(), limitOrder.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 adaptsBidLimitOrder() { Date now = new Date(); LimitOrder limitOrder = new LimitOrder( OrderType.BID, new BigDecimal("1"), CurrencyPair.BTC_USD, null, now, new BigDecimal("6000")); LgoPlaceOrder bidOrder = LgoAdapters.adaptLimitOrder(limitOrder); assertThat(bidOrder) .isEqualToComparingFieldByField( new LgoPlaceLimitOrder( 0, "B", "BTC-USD", new BigDecimal("1"), new BigDecimal("6000"), now.toInstant())); }
@Test public void adaptsAskLimitOrder() { Date timestamp = new Date(); LimitOrder limitOrder = new LimitOrder( OrderType.ASK, new BigDecimal("1"), CurrencyPair.BTC_USD, null, timestamp, new BigDecimal("6000")); LgoPlaceOrder bidOrder = LgoAdapters.adaptLimitOrder(limitOrder); assertThat(bidOrder) .isEqualToComparingFieldByField( new LgoPlaceLimitOrder( 0, "S", "BTC-USD", new BigDecimal("1"), new BigDecimal("6000"), timestamp.toInstant())); }