### Question:
LongParser implements ConfigurationParser { @Override public Long parseValue(String value, Class targetType) { if(value == null) throw new ConfigurationParserException("Could not parse 'null' to long"); return Long.parseLong(value); }  @Override Set<Class> getResponsibleClasses(); @Override Long parseValue(String value, Class targetType);  }### Answer:
@Test public void parseValue() { assertEquals(1L, parser.parseValue("1", Long.class)); assertEquals(-5564L, parser.parseValue("-5564", Long.class)); assertEquals(35005L, parser.parseValue("35005", Long.class)); assertEquals(-8L, parser.parseValue("-8", Long.class)); assertEquals(0L, parser.parseValue("0", Long.class)); }
@Test(expected = ConfigurationParserException.class) public void parseNull() { parser.parseValue(null, Long.class); fail(); }
@Test(expected = NumberFormatException.class) public void parseInvalidDouble1() { parser.parseValue("asdf", Long.class); fail(); }
@Test(expected = NumberFormatException.class) public void parseInvalidDouble2() { parser.parseValue("5,555.5", Long.class); fail(); }