ReportMonth { public boolean isDateWithinCurrentReportMonth(LocalDate lastReportedDate) { return areDatesBelongToSameReportingMonth(lastReportedDate, DateUtil.today()); }  Date startDateOfReportingYear(); int reportingYear(); LocalDate startDateOfNextReportingMonth(LocalDate date); LocalDate endDateOfReportingMonthGivenStartDate(LocalDate startDate); LocalDate startOfCurrentReportMonth(LocalDate date); LocalDate endOfCurrentReportMonth(LocalDate date); boolean isDateWithinCurrentReportMonth(LocalDate lastReportedDate); int reportingMonth(LocalDate date); int reportingYear(LocalDate date); boolean areDatesBelongToSameReportingMonth(LocalDate date, LocalDate anotherDate);  }
@Test public void shouldCheckWhetherTheDateIsWithInTheReportingMonth() throws Exception { DateUtil.fakeIt(LocalDate.parse("2013-01-26")); assertTrue(reportMonth.isDateWithinCurrentReportMonth(LocalDate.parse("2013-01-26"))); assertTrue(reportMonth.isDateWithinCurrentReportMonth(LocalDate.parse("2013-02-01"))); assertTrue(reportMonth.isDateWithinCurrentReportMonth(LocalDate.parse("2013-02-25"))); assertFalse(reportMonth.isDateWithinCurrentReportMonth(LocalDate.parse("2013-01-25"))); assertFalse(reportMonth.isDateWithinCurrentReportMonth(LocalDate.parse("2013-02-26"))); DateUtil.fakeIt(LocalDate.parse("2012-12-26")); assertTrue(reportMonth.isDateWithinCurrentReportMonth(LocalDate.parse("2013-01-01"))); assertTrue(reportMonth.isDateWithinCurrentReportMonth(LocalDate.parse("2013-01-25"))); }