@Test
public void consumeCommand() throws Exception {

	CommandBuffer buffer = new CommandBuffer(2);
	buffer.addCommand(createCmd(1));
	assertEquals(1, buffer.consumeCommand().getId());
	assertNull(buffer.consumeCommand());
	buffer.addCommand(createCmd(2));
	buffer.addCommand(createCmd(3));
	assertEquals(2, buffer.consumeCommand().getId());
	assertEquals(3, buffer.consumeCommand().getId());
	assertNull(buffer.consumeCommand());
}