code: private Date readOptionalDate(JSONValue val) {
  
          JSONString str = null == val ? null : val.isString();
          if (str != null) {
              try {
                  return new Date(Long.parseLong(str.stringValue()));
              } catch (@SuppressWarnings("unused") NumberFormatException e) {
                  // do nothing - return the default value
              }
          }
          return null;
      }
docs: Read an optional Date value form a JSON value.
  @param val the JSON value that should represent the Date as long value in a string.
  @return the Date from the JSON or null if reading the date fails.