}
throw new IllegalArgumentException("Start date and end date were the same but their day of month was not the same as that required");
}
final List<ZonedDateTime> dates = new ArrayList<>();
int year = endDate.getYear();
Month month = startDate.getMonth();
ZonedDateTime date = startDate.withMonth(month.getValue()).withDayOfMonth(_dayOfMonth);
if (date.isBefore(startDate)) {
month = month.plus(1);
date = date.withMonth(month.getValue());
}
year = date.getYear();
while (!date.isAfter(endDate)) {
dates.add(date);
month = month.plus(1);
if (month == Month.JANUARY) {
year++;
}
date = date.with(LocalDate.of(year, month.getValue(), _dayOfMonth));
}
return dates.toArray(EMPTY_ZONED_DATE_TIME_ARRAY);
}