code: private static LocalDate create(int year, int month, int dayOfMonth) {
          if (dayOfMonth > 28) {
              int dom = 31;
              switch (month) {
                  case 2:
                      dom = (IsoChronology.INSTANCE.isLeapYear(year) ? 29 : 28);
                      break;
                  case 4:
                  case 6:
                  case 9:
                  case 11:
                      dom = 30;
                      break;
              }
              if (dayOfMonth > dom) {
                  if (dayOfMonth == 29) {
                      throw new DateTimeException("Invalid date 'February 29' as '" + year + "' is not a leap year");
                  } else {
                      throw new DateTimeException("Invalid date '" + Month.of(month).name() + " " + dayOfMonth + "'");
                  }
              }
          }
          return new LocalDate(year, month, dayOfMonth);
      }
docs: Creates a local date from the year, month and day fields.
  
  @param year  the year to represent, validated from MIN_YEAR to MAX_YEAR
  @param month  the month-of-year to represent, from 1 to 12, validated
  @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