GeminiAdapters { public static Order adaptOrder(GeminiOrderStatusResponse geminiOrderStatusResponse) { Long id = geminiOrderStatusResponse.getId(); CurrencyPair currencyPair = adaptCurrencyPair(geminiOrderStatusResponse.getSymbol()); BigDecimal averageExecutionPrice = geminiOrderStatusResponse.getAvgExecutionPrice(); BigDecimal executedAmount = geminiOrderStatusResponse.getExecutedAmount(); BigDecimal originalAmount = geminiOrderStatusResponse.getOriginalAmount(); OrderType orderType = (geminiOrderStatusResponse.getSide().equals("buy")) ? OrderType.BID : OrderType.ASK; OrderStatus orderStatus = adaptOrderstatus(geminiOrderStatusResponse); Date timestamp = new Date(geminiOrderStatusResponse.getTimestampms() / 1000); if (geminiOrderStatusResponse.getType().contains("limit")) { BigDecimal limitPrice = geminiOrderStatusResponse.getPrice(); return new LimitOrder( orderType, originalAmount, currencyPair, id.toString(), timestamp, limitPrice, averageExecutionPrice, executedAmount, null, orderStatus); } else if (geminiOrderStatusResponse.getType().contains("market")) { return new MarketOrder( orderType, originalAmount, currencyPair, id.toString(), timestamp, averageExecutionPrice, executedAmount, null, orderStatus); } throw new NotYetImplementedForExchangeException(); } private  GeminiAdapters(); static List<CurrencyPair> adaptCurrencyPairs(Collection<String> GeminiSymbol); static CurrencyPair adaptCurrencyPair(String symbol); static String adaptCurrencyPair(CurrencyPair pair); static OrderBook adaptOrderBook(GeminiDepth btceDepth, CurrencyPair currencyPair); static OrdersContainer adaptOrders(
      GeminiLevel[] GeminiLevels, CurrencyPair currencyPair, OrderType orderType); static Order adaptOrder(GeminiOrderStatusResponse geminiOrderStatusResponse); static LimitOrder adaptOrder(
      BigDecimal amount,
      BigDecimal price,
      CurrencyPair currencyPair,
      OrderType orderType,
      Date timestamp); static List<FixedRateLoanOrder> adaptFixedRateLoanOrders(
      GeminiLendLevel[] orders, String currency, String orderType, String id); static FixedRateLoanOrder adaptFixedRateLoanOrder(
      String currency,
      BigDecimal amount,
      int dayPeriod,
      String direction,
      String id,
      BigDecimal rate); static List<FloatingRateLoanOrder> adaptFloatingRateLoanOrders(
      GeminiLendLevel[] orders, String currency, String orderType, String id); static FloatingRateLoanOrder adaptFloatingRateLoanOrder(
      String currency,
      BigDecimal amount,
      int dayPeriod,
      String direction,
      String id,
      BigDecimal rate); static Trade adaptTrade(GeminiTrade trade, CurrencyPair currencyPair); static Trades adaptTrades(GeminiTrade[] trades, CurrencyPair currencyPair); static Ticker adaptTicker(GeminiTicker GeminiTicker, CurrencyPair currencyPair); static Wallet adaptWallet(GeminiBalancesResponse[] response); static OpenOrders adaptOrders(GeminiOrderStatusResponse[] activeOrders); static UserTrades adaptTradeHistory(GeminiTradeResponse[] trades, String symbol); static ExchangeMetaData adaptMetaData(
      List<CurrencyPair> currencyPairs, ExchangeMetaData metaData); static Map<CurrencyPair, Fee> AdaptDynamicTradingFees(
      GeminiTrailingVolumeResponse volumeResponse, List<CurrencyPair> currencyPairs); static FundingRecord adapt(GeminiTransfer transfer); static final Logger log; }
@Test public void testAdaptMarketOrder() throws IOException { InputStream is = GeminiAdaptersTest.class.getResourceAsStream( "/org/knowm/xchange/gemini/v1/order/example-limit-order-status.json"); ObjectMapper mapper = new ObjectMapper(); GeminiOrderStatusResponse geminiOrderStatusResponse = mapper.readValue(is, GeminiOrderStatusResponse.class); Order order = GeminiAdapters.adaptOrder(geminiOrderStatusResponse); assertThat(order.getId()).isEqualTo("44375901"); assertThat(order.getAveragePrice()).isEqualTo(new BigDecimal("400.00")); assertThat(order.getCumulativeAmount()).isEqualTo(new BigDecimal("3")); assertThat(order.getCurrencyPair()).isEqualTo(CurrencyPair.BTC_USD); assertThat(LimitOrder.class.isAssignableFrom(order.getClass())); }