### Question:
BooleanAccessor implements PropertyAccessor<Boolean> { @Override public byte[] toBytes(Object object) { if (object != null) { Boolean b = (Boolean) object; return new byte[] { (byte) (b ? 0x01 : 0x00) }; } return null; }  @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 testToBytes() { Assert.assertNull(accessor.toBytes(null)); byte[] b = accessor.toBytes(new Boolean(true)); Boolean bb = accessor.fromBytes(Boolean.class, b); Assert.assertEquals(true, bb.booleanValue()); }