UndoManager { public boolean canRedo() { return !this.availableRedos.isEmpty(); } 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(expected = IllegalStateException.class) public void testCanRedo() { Assert.assertFalse(this.undoManager.canRedo()); this.undoManager.undoableEditHappened(this.managedModel); Assert.assertFalse(this.undoManager.canRedo()); this.undoManager.undo(); Assert.assertTrue(this.undoManager.canRedo()); this.undoManager.redo(); Assert.assertFalse(this.undoManager.canRedo()); this.undoManager.redo(); }