### Question:
DateUtil { public static Date addMonth(Date date, int difference){ Calendar calendar = calendarDate(date); calendar.add(Calendar.MONTH, difference); return calendar.getTime(); }  static Date getMonthStartDate(Date date); static Date getMonthEndDate(Date date); static int maxMonthDate(Date date); static Date addDayOfMonth(Date date); static Date addDayOfMonth(Date date, int difference); static Date addMonth(Date date, int difference); static Calendar calendarDate(Date date); static boolean equal(Date date1, Date date2); static int dayNumber(Date date); static String formatDate(Date date); static String formatDate(Date date, String format); static Date parseString(String string, String format); static Date today(); static int numDaysToEndOfMonth(); static int monthNumber(Date date); static int monthNumber(); static SimpleDateFormat dateFormater; }### Answer:
@Test public void shouldAddMonth() throws Exception { SimpleDateFormat month = new SimpleDateFormat("MM"); Date date = DateUtil.addMonth(new SimpleDateFormat("yyyyMMdd").parse("20150101"), -1); assertThat(month.format(date), is("12")); date = DateUtil.addMonth(new SimpleDateFormat("yyyyMMdd").parse("20150101"), 1); assertThat(month.format(date), is("02")); }