@Test
public void valueOfString() throws Exception {

  Calendar dateTime = Calendar.getInstance();
  dateTime.clear();
  assertEqualCalendar(dateTime, instance.valueOfString("00:00", null, null, null, null, null, Calendar.class));
  assertEqualCalendar(dateTime, instance.valueOfString("00:00:00", null, null, null, null, null, Calendar.class));
  assertEqualCalendar(dateTime,
      instance.valueOfString("00:00:00.000000000", null, null, null, null, null, Calendar.class));
  final Time timeValue = instance.valueOfString("00:00:00.999", null, null, 3, null, null, Time.class);
  assertEquals(dateTime.getTimeInMillis(), timeValue.getTime());
  dateTime.set(Calendar.MILLISECOND, 999);
  assertEqualCalendar(dateTime,
      instance.valueOfString("00:00:00.999", null, null, 3, null, null, Calendar.class));
  assertEqualCalendar(dateTime,
      instance.valueOfString("00:00:00.999", null, null, 3, null, null, Calendar.class));
  assertEquals(Long.valueOf(dateTime.getTimeInMillis()),
      instance.valueOfString("00:00:00.999", null, null, 3, null, null, Long.class));
  final Timestamp timestamp = instance.valueOfString("00:00:00.999888777", null, null, 9, null, null,
      Timestamp.class);
  assertEquals(dateTime.getTimeInMillis(), timestamp.getTime());
  assertEquals(999888777, timestamp.getNanos());
    expectUnconvertibleErrorInValueOfString(instance, "11:12:13.1234", Calendar.class);
    expectUnconvertibleErrorInValueOfString(instance, "11:12:13.0123456789", Timestamp.class);
  expectContentErrorInValueOfString(instance, "24:32:02");
  expectContentErrorInValueOfString(instance, "011:12:13");
  expectContentErrorInValueOfString(instance, "11:12:13:14");
  expectContentErrorInValueOfString(instance, "111213");
  expectContentErrorInValueOfString(instance, "1:2:3");
  expectContentErrorInValueOfString(instance, "11:12:13.0.1");
    expectContentErrorInValueOfString(instance, "11:12:13.");
  expectContentErrorInValueOfString(instance, "11:12:13.0000000000000");
  expectTypeErrorInValueOfString(instance, "11:12:13");
}