ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
ObjectInputStream ois = new ObjectInputStream(bais);
SerializableObject2 newObj = (SerializableObject2) ois.readObject();
ObjectInputStream.GetField getField = newObj.getGetField();
ObjectStreamClass objectStreamClass = getField.getObjectStreamClass();
assertTrue(objectStreamClass.getField("i").isUnshared());
assertFalse(objectStreamClass.getField("d").isUnshared());
assertTrue(objectStreamClass.getField("s").isUnshared());
assertEquals(1000, getField.get("i", null));
assertEquals(SerializableObject2.today, getField.get("d", null));
assertEquals("Richard", getField.get("s", null));
assertTrue(objectStreamClass.getField("s").getTypeString() == "Ljava/lang/String;");
assertEquals(0, objectStreamClass.getField("d").getOffset());
assertEquals(1, objectStreamClass.getField("i").getOffset());
assertEquals(2, objectStreamClass.getField("s").getOffset());
}