code: private static Date toDateWithFormatString(String date, String format) {
      if (date == null) {
        return null;
      }
  
      try {
        return strategy.formatFor(format).parse(date);
      } catch (ParseException e) {
        UTILS_LOGGER.trace("Unable to parse date '{}' using format string '{}': {}", date, format, e);
  
        return null;
      }
    }
docs: Returns a Java representation of a {@code date} string.
  
  @param date
  Date in string format.
  @return Java date representation of the given {@code date} string or {@code null} if {@code date} is {@code null}
  or invalid.