code: public static LocalDate minDate(final LocalDate date0,
              final LocalDate date1) {
          if (date1 == null) {
              return date0;
          }
          if (date0 == null) {
              return date1;
          }
          if (date1.isBefore(date0)) {
              return date1;
          } else {
              return date0;
          }
      }
docs: Return the earlier of the 2 dates. If either is null return the other.
  
  @param date0 a date
  @param date1 another date
  @return the earlier of the 2 dates