@Test
  public void testDateObject() throws Exception {
    Date date = new Date();

    DataOutputStream out = getDataOutput();
    DataSerializer.writeObject(date, out);
    out.flush();

    DataInput in = getDataInput();
    Date date2 = DataSerializer.readObject(in);
    assertEquals(date, date2);
  }
Tests data serializing a {@link Date} using {@link DataSerializer#writeObject}.
geode-core/src/test/java/org/apache/geode/internal/DataSerializableJUnitTest.java