UndoManager { public void undoableEditHappened(final M changedState) { this.availableUndos.addFirst(changedState.clone()); this.dropExcessiveUndoableStates(); this.availableRedos.clear(); } UndoManager(final M initialState); void reset(final M initialState); void setLimit(final int limit); void undoableEditHappened(final M changedState); M undo(); M redo(); boolean canUndo(); boolean canRedo();  }
@Test public void testUndoableEditHappened() { Assert.assertFalse(this.undoManager.canUndo()); Assert.assertFalse(this.undoManager.canRedo()); this.undoManager.undoableEditHappened(this.managedModel); Assert.assertTrue(this.undoManager.canUndo()); Assert.assertFalse(this.undoManager.canRedo()); }