### Question:
CalendarAccessor implements PropertyAccessor<Calendar> { @Override public Calendar fromBytes(Class targetClass, byte[] b) { Calendar cal = Calendar.getInstance(); Date d = new Date(); if (b == null) { return null; } LongAccessor longAccessor = new LongAccessor(); d.setTime(longAccessor.fromBytes(targetClass, b)); cal.setTime(d); return cal; }  @Override Calendar fromBytes(Class targetClass, byte[] b); @Override byte[] toBytes(Object object); @Override String toString(Object object); @Override Calendar fromString(Class targetClass, String s); @Override Calendar getCopy(Object object); Calendar getInstance(Class<?> clazz);  }### Answer:
@Test public void testFromBytes() { Assert.assertNull(accessor.fromBytes(Calendar.class, null)); Calendar v1 = Calendar.getInstance(); byte[] b = accessor.toBytes(v1); Calendar v2 = accessor.fromBytes(Calendar.class, b); Assert.assertEquals(v1, v2); }