### Question:
FloatConverter implements TypeConverter<Float> { public Float convert(Double d) { return d.floatValue(); } FloatConverter(); Float convert(Double d); Float convert(BigDecimal bd); Float convert(Long bd); Float convert(String v);  }### Answer:
@Test public void Doubleからのconvertテスト() { Double d = 255.255; Float expected = 255.255f; Float actual = new FloatConverter().convert(d); assertEquals(expected, actual); }
@Test public void BigDecimalからのconvertテスト() { BigDecimal f = new BigDecimal("255.255"); Float expected = 255.255f; Float actual = new FloatConverter().convert(f); assertEquals(expected, actual); }
@Test public void Stringからのconvertテスト1() { String s = "255"; Float expected = new Float("255"); Float actual = new FloatConverter().convert(s); assertEquals(expected, actual); }
@Test public void Stringからのconvertテスト2() { String s = null; Float expected = null; Float actual = new FloatConverter().convert(s); assertEquals(expected, actual); }
@Test public void Stringからのconvertテスト3() { String s = ""; Float expected = null; Float actual = new FloatConverter().convert(s); assertEquals(expected, actual); }