Add unit test for PersistentState class.