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