code: HistoricDate adjustDayOfMonth(HistoricDate date) {
  
          Calculus algorithm = this.getAlgorithm(date);
  
          if (algorithm == null) {
              return date; // gap at cutover => let it be unchanged
          }
  
          int max = algorithm.getMaximumDayOfMonth(date);
  
          if (max < date.getDayOfMonth()) {
              return HistoricDate.of(date.getEra(), date.getYearOfEra(), date.getMonth(), max);
          } else {
              return date;
          }
  
      }
docs: <p>Adjusts given historic date with respect to actual maximum of day-of-month if necessary. </p>
  
  @param   date    historic date
  @return  adjusted date
  @throws  IllegalArgumentException if argument is out of range
  @since   3.0