private void checkClass(Object o) throws IOException, ClassNotFoundException {

    DataOutputStream out = getDataOutput();
    DataSerializer.writeObject(o, out);
    out.flush();
    DataInput in = getDataInput();
    assertSame(o.getClass(), DataSerializer.readObject(in).getClass());
    baos = new ByteArrayOutputStream();
  }
Data serializes and then data de-serializes the given object and asserts that the class of
object the pre- and post- data serialized objects is the same.
geode-core/src/test/java/org/apache/geode/internal/DataSerializableJUnitTest.java