### Question:
PointDayPeriodValueFormatter extends AbstractPointValueFormatter { @Override public String format(Object value) { if (value == null) { return null; } DayPeriod dayPeriod = (DayPeriod)value; if (dayPeriod.isOneDayPeriod()) { return formatDate(dayPeriod.getStartDay()); } return formatDate(dayPeriod.getStartDay()) + "-" + formatDate(dayPeriod.getEndDay()); }  @Override String format(Object value); @Override boolean handles(Class<?> valueClass); @Value("1") @Override void setOrder(int order);  }### Answer:
@Test public void format_Null() { assertNull(formatter.format(null)); }
@Test public void format_OneDayPeriod() { DayPeriod value = new DayPeriod(new SimpleLocalDate(new LocalDate(2011, 12, 13)), new SimpleLocalDate(new LocalDate(2011, 12, 13))); assertEquals("13/12/11", formatter.format(value)); }
@Test public void format_RangeDayPeriod() { DayPeriod value = new DayPeriod(new SimpleLocalDate(new LocalDate(2011, 11, 13)), new SimpleLocalDate(new LocalDate(2011, 12, 13))); assertEquals("13/11/11-13/12/11", formatter.format(value)); }