Memento pattern captures the internal state of an object without exposing its internal structure so that the object can be restored to this state later.
- Implementation based on nested classes
- Implementation based on an intermediate interface
- Implementation with even stricter encapsulation