### Question:
SQLDateAccessor implements PropertyAccessor<Date> { @Override public byte[] toBytes(Object object) { try { if (object == null) { return null; } LongAccessor longAccessor = new LongAccessor(); return longAccessor.toBytes(((Date) object).getTime()); } catch (Exception e) { log.error("Error occured, Caused by {}.", e); throw new PropertyAccessException(e); } }  @Override Date fromBytes(Class targetClass, byte[] b); @Override byte[] toBytes(Object object); @Override String toString(Object object); @Override Date fromString(Class targetClass, String s); @Override Date getCopy(Object object); Date getInstance(Class<?> clazz); static Logger log; }### Answer:
@Test public void testToBytes() { Assert.assertNull(accessor.toBytes(null)); long l = System.currentTimeMillis(); Date d = new Date(l); byte[] b = accessor.toBytes(d); Date d2 = accessor.fromBytes(Date.class, b); Assert.assertEquals(d, d2); }