DateParamConverter implements ParamConverter<Date> { @Override public String toString(Date date) { SimpleDateFormat simpleDateFormat = new SimpleDateFormat( _PATTERN_DATE_TIME); return simpleDateFormat.format(date); }  @Override Date fromString(String string); @Override String toString(Date date);  }
@Test public void testToString() { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.DATE, 12); calendar.set(Calendar.HOUR_OF_DAY, 15); calendar.set(Calendar.MILLISECOND, 871); calendar.set(Calendar.MINUTE, 1); calendar.set(Calendar.MONTH, 7); calendar.set(Calendar.SECOND, 58); calendar.set(Calendar.YEAR, 2019); String dateString = _dateParamConverter.toString(calendar.getTime()); Assert.assertEquals("2019-08-12T15:01:58.871Z", dateString); }