IntegerValueConverter extends AbstractValueConverter<Integer> { @Override public Integer convert(String s) { try { return Integer.valueOf(s); } catch (RuntimeException e) { throw new IllegalArgumentException("Can't convert '" + s + "' to Integer.", e); } }  @Override Integer convert(String s); @Override String toString(Integer value); static final IntegerValueConverter INSTANCE; }
@Test(expected = IllegalArgumentException.class) public void testConvertInvalidTrue() throws Exception { converter.convert("one"); }
@Test public void testConvert() throws Exception { assertEquals(Integer.valueOf(Integer.MAX_VALUE), converter.convert(Integer.toString(Integer.MAX_VALUE))); }
@Test(expected = IllegalArgumentException.class) public void testConvertNull() throws Exception { converter.convert(null); }