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