@Test
	public void testFailedUndoInvalidatesHistory() throws CommandExecutionException, Exception {
		History<ICommand> history = new History<>(new TestHistoryStrategy(), mock(EventBus.class));
		history.setMaximumCapacity(100);
		ICommand cmd = mock(ICommand.class);
		ICommand failingCmd = mock(ICommand.class);
		RuntimeException x = new RuntimeException("Foo");
		doThrow(x).when(failingCmd).undo();
		

		history.execute(cmd);
		history.execute(failingCmd);
		verify(cmd).execute();
		verify(failingCmd).execute();

		try {
			history.undo();
			Assert.fail("Exception not thrown");
		} catch(CommandExecutionException exception) {
			Assert.assertSame(x, exception.getCause());
		}
		Assert.assertFalse(history.hasPastOperations());
		Assert.assertFalse(history.hasFutureOperations());
	}