Added clearStateForTesting() for singleton test
Added JUnit test for UndoManager