### Question:
FloatAccessor implements PropertyAccessor<Float> { @Override public Float fromString(Class targetClass, String s) { try { if (s == null) { return null; } Float f = new Float(s); return f; } catch (NumberFormatException e) { log.error("Number format exception, Caused by {}.", e); throw new PropertyAccessException(e); } }  @Override Float fromBytes(Class targetClass, byte[] data); @Override byte[] toBytes(Object object); @Override String toString(Object object); @Override Float fromString(Class targetClass, String s); @Override Float getCopy(Object object); Float getInstance(Class<?> clazz);  }### Answer:
@Test public void testFromString() { Assert.assertNull(accessor.fromString(Float.class, null)); Float f1 = new Float(4.555); String s = f1.toString(); Float f2 = accessor.fromString(Float.class, s); Assert.assertEquals(f1, f2); }