DateUtils { public static String getPrettyTime(Date date) { if (date != null) { return moment(date.getTime()).fromNow(); } return ""; }  static Date createDate(String dateString); static Date createDate(String dateString,
                                  String dateFormat); static String getDateFormatMask(); static String getDateTimeFormatMask(); static String getDateStr(Date date); static String getDateTimeStr(Date date); static String getPrettyTime(Date date); static String DEFAULT_DATE_FORMAT_MASK; static String DEFAULT_DATE_AND_TIME_FORMAT_MASK; static String DEFAULT_TIME_FORMAT_MASK; }
@Test public void testGetPrettyTimeNull() { assertEquals("", getPrettyTime(null)); }