CoinjarAdapters { public static String orderTypeToBuySell(Order.OrderType orderType) { if (orderType == Order.OrderType.BID) { return "buy"; } else if (orderType == Order.OrderType.ASK) { return "sell"; } else throw new IllegalArgumentException( "Unable to convert orderType " + orderType + " to buy/sell"); } private  CoinjarAdapters(); static String currencyPairToProduct(CurrencyPair pair); static CurrencyPair productToCurrencyPair(String product); static String orderTypeToBuySell(Order.OrderType orderType); static Order.OrderType buySellToOrderType(String buySell); static Order.OrderStatus adaptStatus(String status); static Ticker adaptTicker(CoinjarTicker ticker, CurrencyPair currencyPair); static LimitOrder adaptOrderToLimitOrder(CoinjarOrder coinjarOrder); static UserTrade adaptOrderToUserTrade(CoinjarOrder order); static OrderBook adaptOrderbook(CoinjarOrderBook orderBook, CurrencyPair currencyPair); static UserTrade adaptFillToUserTrade(CoinjarFill coinjarFill);  }
@Test public void orderTypeToBuySell() { assertThat(CoinjarAdapters.buySellToOrderType("buy")).isEqualTo(Order.OrderType.BID); assertThat(CoinjarAdapters.buySellToOrderType("sell")).isEqualTo(Order.OrderType.ASK); }