### Question:
ByteAccessor implements PropertyAccessor<Byte> { @Override public byte[] toBytes(Object object) { if (object == null) { return null; } Byte b = (Byte) object; ByteBuffer buffer = ByteBuffer.allocate(8); buffer.put(b); return buffer.array(); }  @Override Byte fromBytes(Class targetClass, byte[] b); @Override byte[] toBytes(Object object); @Override String toString(Object object); @Override Byte fromString(Class targetClass, String s); @Override Byte getCopy(Object object); Byte getInstance(Class<?> clazz);  }### Answer:
@Test public void testToBytes() { Assert.assertNull(accessor.toBytes(null)); Byte v1 = new Byte("7"); byte[] b = accessor.toBytes(v1); Byte v2 = accessor.fromBytes(Byte.class, b); Assert.assertEquals(v1, v2); }