StringToLongConverter implements StringConverter<Long> { @Override public Long convert(String source) { return isNotEmpty(source) ? valueOf(source) : null; }  @Override Long convert(String source); @Override int getPriority();  }
@Test public void testConvert() { assertEquals(Long.valueOf("1"), converter.convert("1")); assertNull(converter.convert(null)); assertThrows(NumberFormatException.class, () -> { converter.convert("ttt"); }); }