* @param month the month-of-year to represent, validated from 1 to 12
   * @param dayOfMonth the day-of-month to represent, validated from 1 to 31
   * @return the resolved date, not null
   */
  private static LocalDate resolvePreviousValid(int year, int month, int day) {

    switch (month) {
      case 2:
        day = Math.min(day, ISOChrono.INSTANCE.isLeapYear(year) ? 29 : 28);
        break;
      case 4:
      case 6:
      case 9:
      case 11:
        day = Math.min(day, 30);
        break;
    }
    return LocalDate.of(year, month, day);
  }