This demo project is based on the Memento design pattern, as explained in the following links:
[1] https://www.tutorialspoint.com/design_pattern/memento_pattern.htm
[2] https://en.wikipedia.org/wiki/Memento_pattern
Basic implementation:
You can find under /src/org/demo/mementopattern/basic/ a basic demo implementation ([1]). Use the MementoPatternDemo.java class to run this basic example.
BankAccount example:
Under /src/org/demo/mementopattern/ we have a BankAccount example as the Originator class, with some very basic fields and methods. The memento state is a collection of fields in a HashMap object. You can test this implementation by running the MementoPatternDemo.java class.