### Question:
ShortParser implements ConfigurationParser { @Override public Short parseValue(String value, Class targetType) { if(value == null) throw new ConfigurationParserException("Could not parse 'null' to short"); return Short.parseShort(value); }  @Override Set<Class> getResponsibleClasses(); @Override Short parseValue(String value, Class targetType);  }### Answer:
@Test public void parseValue() { assertEquals((short)1, parser.parseValue("1", Short.class)); assertEquals((short)-5564, parser.parseValue("-5564", Short.class)); assertEquals((short)3505, parser.parseValue("3505", Short.class)); assertEquals((short)-8, parser.parseValue("-8", Short.class)); assertEquals((short)0, parser.parseValue("0", Short.class)); }
@Test(expected = ConfigurationParserException.class) public void parseNull() { parser.parseValue(null, Short.class); fail(); }
@Test(expected = NumberFormatException.class) public void parseInvalidDouble1() { parser.parseValue("asdf", Short.class); fail(); }
@Test(expected = NumberFormatException.class) public void parseInvalidDouble2() { parser.parseValue("5.5", Short.class); fail(); }