added a unit test
Merge pull request #19 from lbondaryk/1540_state_restoration

added a unit test