### Question:
DateDatum extends Datum { @Override public int asInt4() { return encode(); } DateDatum(int value);  DateDatum(int year, int month, int day);  DateDatum(String dateStr);  DateDatum(LocalDate date);  DateDatum(byte [] bytes); int getCenturyOfEra(); int getYear(); int getMonthOfYear(); int getWeekyear(); int getWeekOfWeekyear(); int getDayOfWeek(); int getDayOfMonth(); int getDayOfYear(); String toString(); @Override int asInt4(); @Override long asInt8(); @Override float asFloat4(); @Override double asFloat8(); @Override String asChars(); String toChars(String format); @Override int size(); @Override byte [] asByteArray(); @Override Datum equalsTo(Datum datum); @Override int compareTo(Datum datum); boolean equals(Object obj); @Override int hashCode(); static final int SIZE; static final String DEFAULT_FORMAT_STRING; }### Answer:
@Test public final void testAsInt4() { Datum d = DatumFactory.createDate(DATE); Datum copy = DatumFactory.createDate(d.asInt4()); assertEquals(d, copy); }
@Test public final void testInstance() { DateDatum d = DatumFactory.createDate(DATE); DateDatum copy = new DateDatum(d.asInt4()); assertEquals(d, copy); }