SimpleDateFormatTS implements FormatTS { @Override public String formatObject(Object item) { if (item!=null) { return getDateFormatterInstance().format(item); } return null; }  @Override String formatObject(Object item); @Override Object parse(String data);  }
@Test public void formatObject() { GregorianCalendar cal = new GregorianCalendar(); cal.set(2012, 10, 19, 6, 2, 1); String date1 = simpleDateFormat.formatObject(cal.getTime()); Assert.assertEquals("20121119060201", date1); }
@Test public void formatObject_null() { String dateString = simpleDateFormat.formatObject(null); Assert.assertNull(dateString); }