IbUtils { public static String getOptionRight( OptionTicker.Right right ) { switch( right ) { case Call: return "C"; case Put: return "P"; default: throw new SumZeroException("Unknown option right: " + right); } }  static String translateToIbFuturesSymbol(String symbol); static String getOrderType(TradeOrder.Type orderType); static String getTif(TradeOrder.Duration duration); static String getSecurityType(InstrumentType instrumentType); static String getAction(TradeDirection direction); static QuoteType getQuoteType(int field); static OrderStatus.Status getOrderStatus(String status); static String getExpiryString(int expiryMonth, int expiryYear); static String getExpiryString(int expiryDay, int expiryMonth, int expiryYear); static String getOptionRight( OptionTicker.Right right ); static Image getIconImage(); static BigDecimal getIbMultiplier( Ticker ticker ); static Vector<TagValue> getDefaultTagVector(); static List<TagValue> getDefaultTagList();  }
@Test public void testGetOptionRight() { assertEquals( "C", IbUtils.getOptionRight(OptionTicker.Right.Call)); assertEquals( "P", IbUtils.getOptionRight(OptionTicker.Right.Put)); }