CaseStatusConverter implements Converter<CaseStatus, String> { @Override public String toWidgetValue(final CaseStatus status) { if (status == null) { return ""; } else { return status.name(); } }  @Override CaseStatus toModelValue(final String status); @Override String toWidgetValue(final CaseStatus status); @Override Class<CaseStatus> getModelType(); @Override Class<String> getComponentType();  }
@Test public void testConvertToWidget() { assertEquals("", converter.toWidgetValue(null)); assertEquals("OPEN", converter.toWidgetValue(CaseStatus.OPEN)); assertEquals("CANCELLED", converter.toWidgetValue(CaseStatus.CANCELLED)); assertEquals("CLOSED", converter.toWidgetValue(CaseStatus.CLOSED)); }