code: protected Date massageDate (Object arg)
      {
          if (arg instanceof Long) {
              return new Date(((Long)arg).longValue());
          } else if (arg instanceof Date) {
              return (Date)arg;
          } else if (arg instanceof Calendar) {
              return ((Calendar)arg).getTime();
          } else {
              System.err.println("Date provided with invalid argument " +
                                 "[arg=" + arg + ", aclass=" +
                                 StringUtil.shortClassName(arg) + "].");
              return null;
          }
      }
docs: Converts an argument to a {@link Date} if possible.