### Question:
PointMonthPeriodValueFormatter extends AbstractPointValueFormatter { @Override public String format(Object value) { if (value == null) { return null; } MonthPeriod monthPeriod = (MonthPeriod)value; if (monthPeriod.isOneMonthPeriod()) { return format(monthPeriod.getStartYear(), monthPeriod.getEndMonthOfYear()); } return format(monthPeriod.getStartYear(), monthPeriod.getStartMonthOfYear()) + "-" + format(monthPeriod.getEndYear(), monthPeriod.getEndMonthOfYear()); }  @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_OneMonthPeriod() { MonthPeriod value = new MonthPeriod(2009, 10, 2009, 10); assertEquals("10/2009", formatter.format(value)); }
@Test public void format_RangeMonthPeriod() { MonthPeriod value = new MonthPeriod(2009, 10, 2009, 11); assertEquals("10/2009-11/2009", formatter.format(value)); }