### Question:
CalendarAccessor implements PropertyAccessor<Calendar> { @Override public Calendar fromString(Class targetClass, String s) { if (s == null) { return null; } Calendar cal = Calendar.getInstance(); Date d; d = DateAccessor.getDateByPattern(s); 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 testFromString() { Assert.assertNull(accessor.fromString(Calendar.class, null)); Calendar v1 = Calendar.getInstance(); String s = v1.getTime().getTime() + ""; Calendar v2 = accessor.fromString(Calendar.class, s); Assert.assertEquals(v1, v2); }