@Test public void testRedo() { this.managedModel.changeState(); this.undoManager.undoableEditHappened(this.managedModel); this.undoManager.undo(); final TestModelImpl redoResult = this.undoManager.redo(); Assert.assertNotSame(this.managedModel, redoResult); Assert.assertEquals(this.managedModel, redoResult); }
public M redo() throws IllegalStateException { if (!this.canRedo()) { throw new IllegalStateException(); } final M previousState = this.availableRedos.pollFirst(); this.availableUndos.addFirst(previousState); this.dropExcessiveUndoableStates(); return previousState; }
UndoManager { public M redo() throws IllegalStateException { if (!this.canRedo()) { throw new IllegalStateException(); } final M previousState = this.availableRedos.pollFirst(); this.availableUndos.addFirst(previousState); this.dropExcessiveUndoableStates(); return previousState; } }
UndoManager { public M redo() throws IllegalStateException { if (!this.canRedo()) { throw new IllegalStateException(); } final M previousState = this.availableRedos.pollFirst(); this.availableUndos.addFirst(previousState); this.dropExcessiveUndoableStates(); return previousState; } UndoManager(final M initialState); }
UndoManager { public M redo() throws IllegalStateException { if (!this.canRedo()) { throw new IllegalStateException(); } final M previousState = this.availableRedos.pollFirst(); this.availableUndos.addFirst(previousState); this.dropExcessiveUndoableStates(); return previousState; } 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 redo() throws IllegalStateException { if (!this.canRedo()) { throw new IllegalStateException(); } final M previousState = this.availableRedos.pollFirst(); this.availableUndos.addFirst(previousState); this.dropExcessiveUndoableStates(); return previousState; } 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();  }