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