### Question:
DoubleParser implements ConfigurationParser { @Override public Double parseValue(String value, Class targetType) { if(value == null) throw new ConfigurationParserException("Could not parse 'null' to double"); return Double.parseDouble(value); }  @Override Set<Class> getResponsibleClasses(); @Override Double parseValue(String value, Class targetType);  }### Answer:
@Test public void parseValue() { assertEquals(1.0d, parser.parseValue("1", Double.class)); assertEquals(-5.564d, parser.parseValue("-5.564", Double.class)); assertEquals(3500.5d, parser.parseValue("3500.5", Double.class)); assertEquals(-8d, parser.parseValue("-8", Double.class)); assertEquals(0d, parser.parseValue("0", Double.class)); }
@Test(expected = ConfigurationParserException.class) public void parseNull() { parser.parseValue(null, Double.class); fail(); }
@Test(expected = NumberFormatException.class) public void parseInvalidDouble1() { parser.parseValue("asdf", Double.class); fail(); }
@Test(expected = NumberFormatException.class) public void parseInvalidDouble2() { parser.parseValue("5,555.5", Double.class); fail(); }