### Question:
StringAccessor implements PropertyAccessor<String> { @Override public final String fromBytes(Class targetClass, byte[] bytes) { try { return bytes != null ? new String(bytes, Constants.CHARSET_UTF8) : null; } catch (UnsupportedEncodingException e) { log.error("Unsupported encoding exception, Caused by {}.", e); throw new PropertyAccessException(e); } }  @Override final String fromBytes(Class targetClass, byte[] bytes); @Override final byte[] toBytes(Object s); @Override final String toString(Object object); @Override String fromString(Class targetClass, String s); @Override String getCopy(Object object); String getInstance(Class<?> clazz); static Logger log; }### Answer:
@Test public void testFromBytes() { Assert.assertNull(accessor.fromBytes(String.class, null)); String d1 = new String("AAA"); byte[] b = accessor.toBytes(d1); String d2 = accessor.fromBytes(String.class, b); Assert.assertEquals(d1, d2); }