[Demonstration 1]

[Buggy Method]
@Test
public void commandBox_nextCommand_exceedingIndex() {
    commandBox.runCommand(COMMAND_THAT_SUCCEEDS);
    commandBox.runCommand(ANOTHER_COMMAND_THAT_SUCCEEDS);
    commandBox.previousCommand();
    commandBox.previousCommand();
    commandBox.nextCommand();
    commandBox.nextCommand();
    commandBox.nextCommand();
    assertEquals(ANOTHER_COMMAND_THAT_SUCCEEDS, commandBox.getCommandInput());
}

[Buggy Hunk]
assertEquals(ANOTHER_COMMAND_THAT_SUCCEEDS, commandBox.getCommandInput());

[Patch]
assertEquals(FIRST_INDEXT_COMMAND_STRING, commandBox.getCommandInput());

[Demonstration 2]

[Buggy Method]
public void moveCaretToLastLine() {
    changeVisualCaretPosition(x_index_caret_visual, super.getHeight() - 1);
    changeActualCaretPosition(x_index_caret_visual, super.getHeight() - 1);
}

[Buggy Hunk]
changeActualCaretPosition(x_index_caret_visual, super.getHeight() - 1);

[Patch]
changeActualCaretPosition(x_index_caret_actual, maxVerticalCharacters - 1);

[Demonstration 3]

[Buggy Method]
@Override
public String getCommand() {
    return getHandle().getCommand();
}

[Buggy Hunk]
return getHandle().getCommand();

[Patch]
return get(CommandData.class).getStoredCommand();