Java serialization reference based on examples