@Test
public void valueOfStringToLong() throws Exception {

  Calendar dateTime = Calendar.getInstance();
  dateTime.clear();
  setTimeZone(dateTime, "GMT");
  dateTime.set(2012, 1, 29, 1, 2, 3);
  assertEquals(Long.valueOf(dateTime.getTimeInMillis()),
      instance.valueOfString("2012-02-29T01:02:03+00:00", null, null, null, null, null, Long.class));
  assertEquals(Long.valueOf(120000L),
      instance.valueOfString("1970-01-01T00:02Z", null, null, null, null, null, Long.class));
  assertEquals(Long.valueOf(120000L),
      instance.valueOfString("1970-01-01T00:02", null, null, null, null, null, Long.class));
  assertEquals(Long.valueOf(12L),
      instance.valueOfString("1970-01-01T00:00:00.012", null, null, 3, null, null, Long.class));
  assertEquals(Long.valueOf(120L),
      instance.valueOfString("1970-01-01T00:00:00.12", null, null, 2, null, null, Long.class));
}