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