As we know the memento pattern is without violating encapsulation, capturing and externalize a object's internal state and can be reclaimed later without knowledge of the orginal state.

My question comes here how `java.io.Serializable` is coming under this pattern because when ever we are **serializing any private variable** and writing the object state to a file at the same time the private varible's value is open to the world and the encapsulation seems to be failing here.