FormatLabel extends Label implements IGenericComponent<T, FormatLabel<T>> { @Override public <C> IConverter<C> getConverter(Class<C> type) { return new CustomConverter<C>(); } FormatLabel(String id, IModel<T> model);  FormatLabel(String id); @Override IConverter<C> getConverter(Class<C> type); @SuppressWarnings("unchecked") IModel<T> getModel(); FormatLabel<T> setModel(IModel<T> model); FormatLabel<T> setModelObject(T object); @SuppressWarnings("unchecked") T getModelObject();  }
@Test public void testConverterIsReadOnly() { FormatLabel<Double> fl = new FormatLabel<Double>("id"); startTest(fl); exception.expect(ConversionException.class); fl.getConverter(Double.class).convertToObject("", fl.getLocale()); }
@Test public void testConverterFailsForNullModel() { FormatLabel<Double> fl = new FormatLabel<Double>("id"); startTest(fl); exception.expect(RuntimeException.class); fl.getConverter(Double.class).convertToString(null, fl.getLocale()); }