FuturesUtil { public static String getContractMonthSymbol(int month) { switch (month) { case 1: return "F"; case 2: return "G"; case 3: return "H"; case 4: return "J"; case 5: return "K"; case 6: return "M"; case 7: return "N"; case 8: return "Q"; case 9: return "U"; case 10: return "V"; case 11: return "X"; case 12: return "Z"; default: throw new SumZeroException("Invalid Month: " + month); } }  static String getFullFuturesSymbolWithTwoDigitYear( String ticker, int month, int year ); static String getFullFuturesSymbolWithOneDigitYear( String ticker, int month, int year ); static String getTwoDigitYearString(int year); static String getOneDigitYearString(int year); static String getContractMonthSymbol(int month); static String getMonthAbbreviation(int month);  }
@Test public void testGetContractMonthSymbol() { assertEquals( "F", FuturesUtil.getContractMonthSymbol(1) ); assertEquals( "G", FuturesUtil.getContractMonthSymbol(2) ); assertEquals( "H", FuturesUtil.getContractMonthSymbol(3) ); assertEquals( "J", FuturesUtil.getContractMonthSymbol(4) ); assertEquals( "K", FuturesUtil.getContractMonthSymbol(5) ); assertEquals( "M", FuturesUtil.getContractMonthSymbol(6) ); assertEquals( "N", FuturesUtil.getContractMonthSymbol(7) ); assertEquals( "Q", FuturesUtil.getContractMonthSymbol(8) ); assertEquals( "U", FuturesUtil.getContractMonthSymbol(9) ); assertEquals( "V", FuturesUtil.getContractMonthSymbol(10) ); assertEquals( "X", FuturesUtil.getContractMonthSymbol(11) ); assertEquals( "Z", FuturesUtil.getContractMonthSymbol(12) ); try { FuturesUtil.getContractMonthSymbol(0); fail(); } catch( SumZeroException ex ) { } }