IbUtils { public static String getExpiryString(int expiryMonth, int expiryYear) { StringBuilder sb = new StringBuilder(); sb.append(expiryYear); if (expiryMonth < 10) { sb.append("0"); } sb.append(expiryMonth); return sb.toString(); }  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 testGetExpiryString_MonthYear() { assertEquals( "201709", IbUtils.getExpiryString(9, 2017)); assertEquals( "201710", IbUtils.getExpiryString(10, 2017)); }
@Test public void testGetExpiryString_DayMonthYear() { assertEquals( "20170908", IbUtils.getExpiryString(8, 9, 2017)); assertEquals( "20171110", IbUtils.getExpiryString(10, 11, 2017)); }