code: public LocalDate withYear(int year) {
          if (this.year == year) {
              return this;
          }
          YEAR.checkValidValue(year);
          return resolvePreviousValid(year, month, day);
      }
docs: Returns a copy of this {@code LocalDate} with the year altered.
  <p>
  If the day-of-month is invalid for the year, it will be changed to the last valid day of the month.
  <p>
  This instance is immutable and unaffected by this method call.
  
  @param year  the year to set in the result, from MIN_YEAR to MAX_YEAR
  @return a {@code LocalDate} based on this date with the requested year, not null
  @throws DateTimeException if the year value is invalid