class ProjectionRepositoryImpl implements ProjectionRepository, Constants {

    public List<LocalDate> getListOfLastWeekDateOfQuarter() {
        LocalDate today = LocalDate.now();
        LocalDate startDate = LocalDate.of(today.getYear(), today.getMonth().firstMonthOfQuarter(), 1);
        Month firstMonthOftheQuarter = startDate.getMonth();
        Month secMonthOftheQuarter = startDate.getMonth().plus(1);
        Month thirdMonthOftheQuarter = secMonthOftheQuarter.plus(1);
        List<Month> monthList = new ArrayList<>();
        monthList.add(firstMonthOftheQuarter);
        monthList.add(secMonthOftheQuarter);
        monthList.add(thirdMonthOftheQuarter);
        int year = today.getYear();
        List<LocalDate> lastWeeksOfQuarterList = new ArrayList<>();
        for (Month month : monthList) {
            IntStream.rangeClosed(1, YearMonth.of(year, month).lengthOfMonth())
                    .mapToObj(day -> LocalDate.of(year, month, day))
                    .filter(date -> date.getDayOfWeek() == DayOfWeek.SUNDAY)
                    .forEach(date -> lastWeeksOfQuarterList.add(date));
        }
        return lastWeeksOfQuarterList;
    }

}