### Question:
ShardingValueWrapper { public Date dateValue(final String format) throws ParseException { if (value instanceof Number) { return new Date(((Number) value).longValue()); } if (value instanceof Date) { return (Date) value; } Preconditions.checkArgument(!Strings.isNullOrEmpty(format)); return new SimpleDateFormat(format).parse(value.toString()); } ShardingValueWrapper(final Comparable<?> value); long longValue(); double doubleValue(); Date dateValue(final String format); Date dateValue(); String toString(final String format); @Override String toString();  }### Answer:
@Test public void testDateValue() throws Exception { Date now = new Date(); assertThat(new ShardingValueWrapper(now).dateValue(), is(now)); assertThat(new ShardingValueWrapper(now.getTime()).dateValue(), is(now)); assertThat(new ShardingValueWrapper(format.format(date)).dateValue(FORMAT_TEXT), is(date)); }