### Question:
LongConverter implements Converter<Long> { @Override public Long convert(String toBeConverted) throws ConversionException { if (toBeConverted == null || toBeConverted.isEmpty()) { return null; } try { return Long.parseLong(toBeConverted); } catch (NumberFormatException e) { throw new ConversionException(toBeConverted + " cannot be converted to Long", e); } }  @Override Long convert(String toBeConverted);  }### Answer:
@Test public void nullIsConvertedToNull() throws Exception { Long converted = converter.convert(null); assertNull(converted); }
@Test public void emptyIsConvertedToNull() throws Exception { Long converted = converter.convert(""); assertNull(converted); }
@Test public void longNumberIsParsedToLong() throws Exception { long converted = converter.convert("456789"); assertEquals(456789L, converted); }
@Test(expected = ConversionException.class) public void nonParsableStringThrowAConversionException() throws Exception { converter.convert("nonParsable"); }