### Question:
IntegerAccessor implements PropertyAccessor<Integer> { @Override public final byte[] toBytes(Object val) { if (val != null) { Integer value = (Integer) (val); return new byte[] { (byte) (value >>> 24), (byte) (value >>> 16), (byte) (value >>> 8), (byte) value.intValue() }; } return null; }  @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 testToBytes() { Assert.assertNull(accessor.toBytes(null)); Integer d1 = new Integer(4); byte[] b = accessor.toBytes(d1); Integer d2 = accessor.fromBytes(Integer.class, b); Assert.assertEquals(d1, d2); }