* @param month the month-of-year to represent, validated not null
   * @param dayOfMonth the day-of-month to represent, validated from 1 to 31
   * @return the local date, not null
   * @throws DateTimeException if the day-of-month is invalid for the month-year
   */
  private static LocalDate create(int year, Month month, int dayOfMonth) {

    if (dayOfMonth > 28 && dayOfMonth > month.length(ISOChrono.INSTANCE.isLeapYear(year))) {
      if (dayOfMonth == 29) {
        throw new DateTimeException("Invalid date 'February 29' as '" + year + "' is not a leap year");
      } else {
        throw new DateTimeException("Invalid date '" + month.name() + " " + dayOfMonth + "'");
      }
    }
    return new LocalDate(year, month.getValue(), dayOfMonth);
  }