FuturesUtil { public static String getMonthAbbreviation(int month) { switch(month) { case 1: return "JAN"; case 2: return "FEB"; case 3: return "MAR"; case 4: return "APR"; case 5: return "MAY"; case 6: return "JUN"; case 7: return "JUL"; case 8: return "AUG"; case 9: return "SEP"; case 10: return "OCT"; case 11: return "NOV"; case 12: return "DEC"; 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 testGetMonthAbbreviation() { assertEquals( "JAN", FuturesUtil.getMonthAbbreviation(1) ); assertEquals( "FEB", FuturesUtil.getMonthAbbreviation(2) ); assertEquals( "MAR", FuturesUtil.getMonthAbbreviation(3) ); assertEquals( "APR", FuturesUtil.getMonthAbbreviation(4) ); assertEquals( "MAY", FuturesUtil.getMonthAbbreviation(5) ); assertEquals( "JUN", FuturesUtil.getMonthAbbreviation(6) ); assertEquals( "JUL", FuturesUtil.getMonthAbbreviation(7) ); assertEquals( "AUG", FuturesUtil.getMonthAbbreviation(8) ); assertEquals( "SEP", FuturesUtil.getMonthAbbreviation(9) ); assertEquals( "OCT", FuturesUtil.getMonthAbbreviation(10) ); assertEquals( "NOV", FuturesUtil.getMonthAbbreviation(11) ); assertEquals( "DEC", FuturesUtil.getMonthAbbreviation(12) ); try { FuturesUtil.getContractMonthSymbol(0); fail(); } catch( SumZeroException ex ) { } }