@Test public void isNotSameMonth() { assertFalse(dateUtil.isSameMonth(new Date(), DateUtils.addMonths(new Date(), -1))); }
public boolean isSameMonth(Date date, Date otherDate) { Calendar calendar = calendarFor(date); Calendar otherCalendar = calendarFor(otherDate); return calendar.get(Calendar.MONTH) == otherCalendar.get(Calendar.MONTH); }
DateUtil { public boolean isSameMonth(Date date, Date otherDate) { Calendar calendar = calendarFor(date); Calendar otherCalendar = calendarFor(otherDate); return calendar.get(Calendar.MONTH) == otherCalendar.get(Calendar.MONTH); } }
DateUtil { public boolean isSameMonth(Date date, Date otherDate) { Calendar calendar = calendarFor(date); Calendar otherCalendar = calendarFor(otherDate); return calendar.get(Calendar.MONTH) == otherCalendar.get(Calendar.MONTH); }  }
DateUtil { public boolean isSameMonth(Date date, Date otherDate) { Calendar calendar = calendarFor(date); Calendar otherCalendar = calendarFor(otherDate); return calendar.get(Calendar.MONTH) == otherCalendar.get(Calendar.MONTH); }  boolean isSameMonth(Date date, Date otherDate); boolean isSameYear(Date date, Date otherDate); Calendar calendarFor(Date date); Date dateFor(int day, int month, int year); Calendar getCalendarWithTime(int hourOfTheDay, int minutes, int seconds); }
DateUtil { public boolean isSameMonth(Date date, Date otherDate) { Calendar calendar = calendarFor(date); Calendar otherCalendar = calendarFor(otherDate); return calendar.get(Calendar.MONTH) == otherCalendar.get(Calendar.MONTH); }  boolean isSameMonth(Date date, Date otherDate); boolean isSameYear(Date date, Date otherDate); Calendar calendarFor(Date date); Date dateFor(int day, int month, int year); Calendar getCalendarWithTime(int hourOfTheDay, int minutes, int seconds);  }