@Test
public void valueOfStringToCalendar() throws Exception {

  Calendar dateTime = Calendar.getInstance();
  dateTime.clear();
  setTimeZone(dateTime, "GMT");
  dateTime.set(2012, 1, 29, 1, 2, 3);
  assertEqualCalendar(dateTime,
      instance.valueOfString("2012-02-29T01:02:03Z", null, null, null, null, null, Calendar.class));
  assertEqualCalendar(dateTime,
      instance.valueOfString("2012-02-29T01:02:03", null, null, null, null, null, Calendar.class));
  dateTime.clear();
  setTimeZone(dateTime, "GMT-01:30");
  dateTime.set(2012, 1, 29, 1, 2, 3);
  assertEquals(dateTime.getTime(),
      instance.valueOfString("2012-02-29T01:02:03-01:30", null, null, null, null, null, Date.class));
  dateTime.clear();
  setTimeZone(dateTime, "GMT+11:00");
  dateTime.set(2012, 1, 29, 1, 2, 3);
  assertEqualCalendar(dateTime,
      instance.valueOfString("2012-02-29T01:02:03+11:00", null, null, null, null, null, Calendar.class));
  dateTime.add(Calendar.MILLISECOND, 7);
  assertEqualCalendar(dateTime,
      instance.valueOfString("2012-02-29T01:02:03.007+11:00", null, null, 3, null, null, Calendar.class));
}