TimerInstanceDelayConverter implements Converter<Long, String> { @Override public String toWidgetValue(Long delay) { if (delay == null) { return constants.NA(); } else { return duration(delay.intValue()).humanize() + " ( " + delay / 1000 + " " + constants.Seconds() + " )"; } }  @Override Class<Long> getModelType(); @Override Class<String> getComponentType(); @Override Long toModelValue(String value); @Override String toWidgetValue(Long delay);  }
@Test public void testDelay() { final String widgetValue = converter.toWidgetValue(2000l); assertEquals(" ( 2 Seconds )", widgetValue); }
@Test public void testEmptyDelay() { final String widgetValue = converter.toWidgetValue(null); assertEquals(Constants.INSTANCE.NA(), widgetValue); }