@Test public void testUndo() { this.managedModel.changeState(); this.undoManager.undoableEditHappened(this.managedModel); final TestModelImpl undoResult = this.undoManager.undo(); Assert.assertNotEquals(this.managedModel, undoResult); Assert.assertEquals(UndoManagerTest.MODEL_CLONE, undoResult); }
public M undo() throws IllegalStateException { if (!this.canUndo()) { throw new IllegalStateException(); } this.availableRedos.addFirst(this.availableUndos.pollFirst()); return this.availableUndos.getFirst(); }
UndoManager { public M undo() throws IllegalStateException { if (!this.canUndo()) { throw new IllegalStateException(); } this.availableRedos.addFirst(this.availableUndos.pollFirst()); return this.availableUndos.getFirst(); } }
UndoManager { public M undo() throws IllegalStateException { if (!this.canUndo()) { throw new IllegalStateException(); } this.availableRedos.addFirst(this.availableUndos.pollFirst()); return this.availableUndos.getFirst(); } UndoManager(final M initialState); }
UndoManager { public M undo() throws IllegalStateException { if (!this.canUndo()) { throw new IllegalStateException(); } this.availableRedos.addFirst(this.availableUndos.pollFirst()); return this.availableUndos.getFirst(); } 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(); }
UndoManager { public M undo() throws IllegalStateException { if (!this.canUndo()) { throw new IllegalStateException(); } this.availableRedos.addFirst(this.availableUndos.pollFirst()); return this.availableUndos.getFirst(); } 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();  }