@Test
public void rewindToCommand() throws Exception {

	CommandBuffer buffer = new CommandBuffer(5);
	for (int i = 1; i <= 4; i++) {
		buffer.addCommand(createCmd(i));
		if (i <= 3) {
			buffer.consumeCommand();
		}
	}
	assertEquals(4, buffer.getBufferedCommandsCount());
	buffer.rewindToCommand(2);
	assertEquals(4, buffer.getBufferedCommandsCount());
	assertEquals(3, buffer.consumeCommand().getId());
	assertEquals(4, buffer.consumeCommand().getId());
	assertNull(buffer.consumeCommand());
}