DateUtil { public static String getDateTime(String aMask, Date aDate) { SimpleDateFormat df = null; String returnValue = ""; if (aDate == null) { log.warn("aDate is null!"); } else { df = new SimpleDateFormat(aMask); returnValue = df.format(aDate); } return (returnValue); } private  DateUtil(); static String getDatePattern(); static String getDateTimePattern(); static String getDate(Date aDate); static Date convertStringToDate(String aMask, String strDate); static String getTimeNow(Date theTime); static Calendar getToday(); static String getDateTime(String aMask, Date aDate); static String convertDateToString(Date aDate); static Date convertStringToDate(final String strDate);  }
@Test public void testGetDateTimeWithNull() { final String date = DateUtil.getDateTime(null, null); assertEquals("", date); }
@Test public void testGetDateTime() { if (log.isDebugEnabled()) { log.debug("entered 'testGetDateTime' method"); } String now = DateUtil.getTimeNow(new Date()); assertTrue(now != null); log.debug(now); }