Java: (De)serialization of Entity, Environment and Effect