### Question:
PointYearPeriodValueFormatter extends AbstractPointValueFormatter { @Override public String format(Object value) { if (value == null) { return null; } YearPeriod yearPeriod = (YearPeriod)value; if (yearPeriod.isOneYearPeriod()) { return ""+yearPeriod.getStartYear(); } return yearPeriod.getStartYear() + "-" + yearPeriod.getEndYear(); }  @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_OneYearPeriod() { YearPeriod value = new YearPeriod(2009, 2009); assertEquals("2009", formatter.format(value)); }
@Test public void format_RangeYearPeriod() { YearPeriod value = new YearPeriod(2009, 2017); assertEquals("2009-2017", formatter.format(value)); }