code: public String dateToString(D date) {
      try {
        return String.format(DATE_PATTERN,
            (Integer) PropertyUtils.getProperty(date, "year"),
            (Integer) PropertyUtils.getProperty(date, "month"),
            (Integer) PropertyUtils.getProperty(date, "day"));
      } catch (IllegalAccessException e) {
        throw new IllegalStateException("Could not access class.", e);
      } catch (InvocationTargetException e) {
        throw new IllegalStateException("Could not get field.", e);
      } catch (NoSuchMethodException e) {
        throw new IllegalStateException("Could not get field.", e);
      }
    }
docs: Returns string representation of this date.
  
  @param date the date to stringify
  @return a string representation of the {@code Date} in {@code yyyy-MM-dd}