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