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