DateTimeConverter implements Converter<Date, String> { @Override public String toWidgetValue(final Date date) { return DateUtils.getDateTimeStr(date); }  @Override Date toModelValue(final String widgetValue); @Override String toWidgetValue(final Date date); @Override Class<Date> getModelType(); @Override Class<String> getComponentType();  }
@Test public void testToWidgetValue() { Date date = new Date(); String dateStr = converter.toWidgetValue(date); final String expected = new SimpleDateFormat("dd/MM/yyyy HH:mm").format(date); assertEquals(expected, dateStr); }