### Question:
ReportsService { public List<Integer> getDayNumbers(Date startDate, Date endDate) { List<Integer> days = new ArrayList<>(); Calendar calendar = DateUtil.calendarDate(startDate); Date upperLimitDate = DateUtil.addDayOfMonth(endDate, 1); while (calendar.getTime().before(upperLimitDate)) { days.add(DateUtil.dayNumber(calendar.getTime())); calendar.add(Calendar.DAY_OF_MONTH, 1); } return days; }  List<FacilityStockReportItem> getFacilityReportItemsForCategory(
            Category category, String startingYear, String startingMonth, String endingYear, String endingMonth); List<FacilityCommodityConsumptionRH1ReportItem> getFacilityCommodityConsumptionReportRH1(Category category, String startingYear,
                                                                                                    String startingMonth, String endingYear, String endingMonth); List<DateTime> getDays(Date start, Date stop); List<Integer> getDayNumbers(Date startDate, Date endDate); List<FacilityConsumptionReportRH2Item> getFacilityConsumptionReportRH2Items(Category category, String startingYear, String startingMonth, String endingYear, String endingMonth); Date convertToDate(String year, String month, boolean isStartingDate); List<MonthlyVaccineUtilizationReportItem> getMonthlyVaccineUtilizationReportItems(
            Category category, String year, String month, boolean isForDevices); BinCard generateBinCard(Commodity commodity);  }### Answer:
@Test public void shouldReturnCorrectNumberOfDaysInFebruary2014() throws Exception { Calendar calendar = Calendar.getInstance(); calendar.set(2014, Calendar.FEBRUARY, 01); Date startDate = calendar.getTime(); calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); Date endDate = calendar.getTime(); List<Integer> days = reportsService.getDayNumbers(startDate, endDate); assertThat(days.size(), is(28)); assertThat(days.get(0), is(1)); assertThat(days.get(27), is(28)); }
@Test public void shouldReturnCorrectNumberOfDaysInOctober() throws Exception { Calendar calendar = Calendar.getInstance(); calendar.set(2014, Calendar.OCTOBER, 01); Date startDate = calendar.getTime(); calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH)); Date endDate = calendar.getTime(); List<Integer> days = reportsService.getDayNumbers(startDate, endDate); assertThat(days.size(), is(31)); assertThat(days.get(0), is(1)); assertThat(days.get(30), is(31)); }