### Question:
DateConverter { public String convert(Calendar date) { if (date == null) { return null; } return dateFormat.format(date.getTime()); }  String convert(Calendar date);  }### Answer:
@Test public void shouldConvertWithCorrectFormat() { Calendar date = new GregorianCalendar(2004, Calendar.FEBRUARY, 29); String result = converter.convert(date); Assert.assertEquals("2004-02-29", result); }
@Test public void shouldHandleNullDate() { String result = converter.convert(null); Assert.assertNull(result); }