code: public String getDateStringOrSuppliedString(String emptyDateString) {
          LocalDate date = getDate();
          return (date == null) ? emptyDateString : date.toString();
      }
docs: getDateStringOrSuppliedString, This returns the last valid date in an ISO-8601 formatted
  string "uuuu-MM-dd". For any CE years that are between 0 and 9999 inclusive, the output will
  have a fixed length of 10 characters. Years before or after that range will output longer
  strings. If the last valid date is empty, this will return the value of emptyDateString.